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

Is it possible to put Scrollable into a position:fixed div? #6

Open
ddcovery opened this issue Oct 9, 2019 · 0 comments
Open

Is it possible to put Scrollable into a position:fixed div? #6

ddcovery opened this issue Oct 9, 2019 · 0 comments

Comments

@ddcovery
Copy link

ddcovery commented Oct 9, 2019

Example: I have a fixed located div into the page and I whant to show a list of intems into and I want to know the "active" one.

<style>
.mycontainer {
  position: fixed;
  top:100px;
  bottom:10px;
  left: 100px;
  right: 10px;
  overflow: auto;
}
</style>

<div class="mycontainer">
<Scroller top={0.2} bottom={0.8} threshold={0.5}  bind:activeItemIndex>
  <div slot="foreground">
    {#each items as  item}
      <section>
	 <p> {item} </p>
 	 <hr />
      </section>
    {/each}
  </div>
</Scroller>
</div>

<script>
  let items = [ "Text 1", "Text 2", "Text 2", "Text 4", "Text 5","Text 6","Text 7", "Text 8", "Text 9" ];
  let activeItemIndex;
  $: { console.log(activeItemIndex); }
  
</script>

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