Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Cannot modify Offset #111

Open
ekntrtmz opened this issue Jul 6, 2021 · 1 comment
Open

Cannot modify Offset #111

ekntrtmz opened this issue Jul 6, 2021 · 1 comment

Comments

@ekntrtmz
Copy link

ekntrtmz commented Jul 6, 2021

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants