javascript - I am applying an ajax when the user scrolled to bottom of the screen but the ajax is keep firing even when the user is at the bottom -


following code using fetch data ajax when user reaches near bottom of page.

$(window).scroll(function() { if($(window).scrolltop() + $(window).height() > $(document).height() - 300) { alert("near bottom!");//this place ajax being applied } }); 

the above code triggering alert function couple of times. when scrolling bact top alert function triggers.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -