davist11/jQuery-One-Page-Nav

Need the ability to set an offset for logic determining where

louiswalch opened this issue · 3 comments

Need the ability to set an offset for scrollTo method.

I have a fixed nav which locks to the top of the viewport. With the current way the scrollTo method works the top part of active section is covered by this nav.

I've seen some "CSS Only" solutions for this problem in the Issue Archive, but this would is not sufficient. CSS impacts the page's layout, and I don't want a bunch of extra padding above each of my sections in order for the scrolling to work correctly.

It seems like allowing for an option to be passed in when initializing the plugin would be possible. Any chance you can support this?

Thank you.

The CSS solution described in the documentation has zero impact on the design.

It requires extra space/padding above the section to offset the amount of the header. That impacts the design of a page.

That's not an accurate statement as you can see from the demo: http://davist11.github.io/jQuery-One-Page-Nav/top.html