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

scrollSpy triggers even when the element is not within the viewport

Open shad-k opened this issue 7 years ago • 0 comments

Hi I am using the following html:

`

` and css: ` #section1, #section2 { height: 100%; width: 100%; } `

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.

shad-k avatar Jul 06 '17 08:07 shad-k