Prinzhorn / skrollr-menu

skrollr plugin for hash navigation
MIT License
285 stars 143 forks source link

Hash navigation on page load ignores data-menu-offset #19

Open kylelondonuk opened 11 years ago

kylelondonuk commented 11 years ago

Hi,

Isee 3 open issues all discussing errors with hash navigation on page load, but they don't seem to specifically site the data-menu-offset being ignored on the initial scroll when you arrive at a page with a hash in the navigation.

I have a website using skrollr with a 60px fixed header, so use data-menu-offset="-60" on each of my content panels. My navigation links work just fine when clicking after the page has loaded, but if you arrive at the page with a hash in the URL, skrollr kicks in and scrolls to the top of that DIV, but ignores the offset. Seems like maybe it's initiating too early or just ignoring that property on init()..

Apologies if this has been covered already - I scrolled through open and closed issues and couldn't find it described quite like this.

Cheers

kylelondonuk commented 11 years ago

(It occurred to me that the error being thrown by skrollr that's described in Issues #8 and #12 may be responsible for this problem, and that actually what I'm seeing is just the default browser behaviour (i.e. the hash in the URL leads the page to knock down to the DIV with that ID, obviously ignoring the offset).)

Prinzhorn commented 11 years ago

Please try version 0.1.6. It should work on mobile as well.