0

i use scrollify for my website. ( https://github.com/lukehaas/Scrollify )

i have a link in my first section that points to a div in the second (standart scroll element) section but when i click on it scrollify always scroll up to the beginning of the second section.

is it somehow possible to make scrollify stay at the right div

i did a fiddle here:

http://jsfiddle.net/rz6yv2up/2/

<section>
  <div id="top"><a href="#item21">Link to Item </a></div>
</section>
<section>
  <div id="bottom">
    <div id="item1">item</div>
    <div id="item2">item</div>
    <div id="item3">item</div>
    <div id="item4">item</div>
    <div id="item5">item</div>
    <div id="item6">item</div>
    <div id="item7">item</div>
    <div id="item8">item</div>
    <div id="item9">item</div>
    <div id="item10">item</div>
    <div id="item11">item</div>
    <div id="item12">item</div>
    <div id="item13">item</div>
    <div id="item14">item</div>
    <div id="item15">item</div>
    <div id="item16">item</div>
    <div id="item17">item</div>
    <div id="item18">item</div>
    <div id="item19">item</div>
    <div id="item20">item</div>
    <div id="item21">item 21</div>
  </div>
</section>

thanks for your help :)

Locke
  • 13
  • 3

1 Answers1

0

It's not scrollify that is doing the scrolling. You're using IDs which are triggering the browsers native scroll anchoring behaviour.

Luke Haas
  • 672
  • 2
  • 6
  • 16
  • are you sure? because when i click the link to the bottom item, it first jumps to this item (native scroll anchor, like i want) but then the browser scrolls up to the beginning of the section, which is a scrollify behaviour? -> maybe the problem is, that i only need scrollify for scroll events. – Locke Oct 19 '16 at 07:29
  • You should be using the Scrollify move method instead of relying on IDs. – Luke Haas Oct 20 '16 at 18:11