Infinite scrolling with ajax does not work with Chrome

Ok, so after doing a lot of research on this very site, I wrote the code for infinite scrolling.

JS:

$(window).scroll(function() {
    if ($(window).scrollTop() + $(window).height() == $(document).height()) {
        alert('This is Bottom!');
    }
});

      

Thing - This works great when working in Mozilla. But when I tried the same in Chrome or Opera it didn't work.

Could you guys help me and tell me where is the problem?

+3


source to share


1 answer


Try using> = instead of ==, if you don't help try displaying each of the variables in console.log and parse this



0


source







All Articles