Search
 
SCRIPT & CODE EXAMPLE
 

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); 
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: check online status javascript 
Javascript :: for object 
Javascript :: javascript timeout 
Javascript :: protected route in react js 
Javascript :: watch with multiple variables vuejs 
Javascript :: custom event js 
Javascript :: factorial javascript function 
Javascript :: react native navigation header right 
Javascript :: node red http post request data 
Javascript :: npm react pagination 
Javascript :: javascript take last element of array 
Javascript :: how to target child element of an event object in JS 
Javascript :: node js cross origin error 
Javascript :: jquery hover event 
Javascript :: set auth header on axios instance 
Javascript :: replace all js 
Javascript :: how to know if ajax is running 
Javascript :: Uncaught TypeError: Object prototype may only be an Object or null: undefined 
Javascript :: how to pass data between components in react 
Javascript :: express receive post 
Javascript :: string compare on date in js 
Javascript :: set attribute in javascript 
Javascript :: data type javascript 
Javascript :: javascript join list of string 
Javascript :: react join array of components 
Javascript :: difference between let and var 
Javascript :: javascript calculate aspect ratio 
Javascript :: JavaScript Splitting a string using a regular expression 
Javascript :: js sort letters 
Javascript :: Random Integer 1-10 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =