Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

$(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); 
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #working #mobile
ADD COMMENT
Topic
Name
2+8 =