How can I detect my document has reached the page bottom on mobile devices?
I have this code works perfectly on desktop devices, but not on mobile devices, such as android phones,
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() == $(document).height()) {
alert("bottom!");
}
});
any idea what else should I include in the code to make it work on mobile?
I am using it for infinite scroll. I have a "load more" link on nearly bottom of page.