jquery-scrollspy
jquery-scrollspy copied to clipboard
scrollSpy triggers even when the element is not within the viewport
Hi I am using the following html:
`
and using the scrollSpy plugin as follows: ` $('#section2').on('scrollSpy:enter', function() { alert("scrolled in"); });
$('#section2').on('scrollSpy:exit', function() {
alert("scrolled out");
});
$('#section2').scrollSpy();
`
When the page loads, even though #section2 is not visible the alert is shown by the browser. How can I avoid this? Also, if increase the height to 101% this issue is not occuring.