Prinzhorn / skrollr

Stand-alone parallax scrolling library for mobile (Android + iOS) and desktop. No jQuery. Just plain JavaScript (and some love).
http://prinzhorn.github.io/skrollr/
MIT License
18.53k stars 3.51k forks source link

navigation link to anchor within skrollr-body: cant scroll up after click #861

Closed baskinco closed 7 years ago

baskinco commented 7 years ago

Inside skrollr-body I have an <a href="#menuitem"..> that links to a <div id="menuitem"..> further down the page. the link takes the user to the correct area, but then the user cannot scroll up to the top of the page from that point. Maybe skrollr is reading the www.pagename.html#menuitem as its own unique page? Hoping someone can point me in the right direction.

Thanks, baskinco

robhadfield commented 7 years ago

Interesting... What code are you using to scroll to the anchor point? Is that something you wrote with JQ or part of Skrollr?

baskinco commented 7 years ago

Just a straight-up HTML id anchor.

<a href="#menuitem1">Menu Item 1</a>
<div class="classname" id="menuitem1"></div>

Both the menu and the div are inside skrollr-body

robhadfield commented 7 years ago

Is the code online anywhere? I'm not that familiar with how Skrollr handles scrollTo links.

baskinco commented 7 years ago

Realized that there is an entire skrollr library just for menus (js/skrollr.menu.min.js) :) Once I added the library and implemented the data-menu-offset method described here, everything worked out just fine. thanks again for your help.

robhadfield commented 7 years ago

ha, great!