jquery-scrollspy icon indicating copy to clipboard operation
jquery-scrollspy copied to clipboard

Incompatible with Scroll-To Functionality

Open isaachinman opened this issue 10 years ago • 0 comments

Hi there. I'm using both scroll-to functions and scrollSpy in a current project, and have noticed they are of course incompatible.

Because scrollSpy listens to window scroll, and scroll-to anchors cause the window to scroll, weird jumping happens, etc. I'm aware there's a throttle, and keeping scrolls well within the throttle interval has prevent most weird stuff, but there are still edge cases that cause weird effects.

Is there currently a way to stop scrollSpy from listening for a set period of time? Would be really useful to be able to setTimeout some var to stop scrollSpy listening while scroll-to stuff is happening.

Eg:

scrollSpyWatching = false;
setTimeout(function() { scrollSpyWatching = true}, 500);

isaachinman avatar Nov 11 '15 11:11 isaachinman