$(window).scroll(function() not working code example
Example: $(window).scrolltop() not working on mobile
$(document.body).on('touchmove', onScroll); // for mobile
$(window).on('scroll', onScroll);
// callback
function onScroll(){
if( $(window).scrollTop() + window.innerHeight >= document.body.scrollHeight ) {
track_page++;
load_contents(track_page);
}
}