Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic data not working #10

Open
MarcWadai opened this issue Jan 21, 2020 · 0 comments
Open

Dynamic data not working #10

MarcWadai opened this issue Jan 21, 2020 · 0 comments

Comments

@MarcWadai
Copy link

When clicking on a button the data from my scroller are updating. But even by updating the index and count. The scroller information are going to stay the same. Is there a way to use the scroller with information that update in time ? Here are an example of my code :

The data that is updating below is the array myPhotos

<Scroller
  top={0.2}
  bottom={0.8}
  bind:index
  bind:offset
  bind:progress
  bind:count>
  <div slot="background">
    <div
      class={index % 2 == 0 ? 'background_wrapper-left' : 'background_wrapper-right'}>
      <div class="background_content" out:fade>
        {#if myPhotos && myPhotos[index]}
          <p>{myPhotos[index].description}</p>
        {/if}
      </div>
    </div>
  </div>

  <div slot="foreground">
    {#each myPhotos as item}
      <section>
        <div class="m_picture">
          {#if visible && myPhotos[index] && myPhotos[index].name == item.name}
            <div class="m_picture-title">
              <span>{item.title}</span>
              <span>{item.location}</span>
            </div>
          {/if}
        </div>
      </section>
    {/each}
  </div>
</Scroller>
@MarcWadai MarcWadai changed the title Updating data not working Dynamic data not working Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant