jimmynotjim/scrollnav

Cannot modify Offset

Opened this issue · 1 comments

Using the newest version of Scrollnav.js:

const content = document.querySelector('.main-content');
const nodeTarget = document.querySelector('.main-navigation');

scrollnav.init(content, {
   sections: 'h1',
   subSections: 'h2',
   insertTarget: nodeTarget,
   scrollOffset: 400 // not working
 });

Unfortunately, after successfully initializing the plugin, there is an offset when triggering the scroll event. I am using a sticky sidebar which may cause the offset.

How can I add scroll offset?

Same here. I want to scroll the container exactly to the headline. At the moment it seems like its 50% offset of screen height.