5

I am trying to implement infinite scroll on my website and it works well on browsers on any computer, but it has issues on mobile browsers. So far, on chrome, if I don't zoom in or out it works ok but once I zoom either way it stops working. On safari it doesn't work at all. This is the code that I am using:

$(window).on('scroll', function (e) {
    console.log(" window.scrollTop = " + $(window).scrollTop() + " document.height=" + $(document).height() + " window.height =" + $(window).height());
    if ($(window).scrollTop() == $(document).height() - $(window).height()) {
        load();
    }
});

If anyone has any suggestions please let me know.

GBreen12
  • 1,832
  • 2
  • 20
  • 38

1 Answers1

1

Instead of using

$(window).height()

try using

window.innerHeight