This question has been asked before (Infinite Scroll on Mobile browsers) but with no response.
I'm trying to implement infinite scroll.
The function to check whether the document is at the bottom, causing more to load is:
if ($(window).scrollTop() == $(document).height() - $(window).height())
This works fine on my computer, but does not work on any browsers on mobile (iOS).
On iPhone 5s for my page, $(document).height()
reports 1055 and $(window).height()
is 504.
But even at the bottom of the page, $(window).scrollTop()
is at most 507.
Therefore 507 != 551 (1055-504)
I believe this may have something to do with $(window).height()
reporting the height of the viewport which is somehow different in mobile.
Any help would be appreciated!