Cannot modify Offset
Opened this issue · 1 comments
ekntrtmz commented
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?
denniserdmann commented
Same here. I want to scroll the container exactly to the headline. At the moment it seems like its 50% offset of screen height.