Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get scroll position jQuery

// Get the current scroll position
let scrollValue = jQuery(window).scrollTop();
console.log('Scroll value: ' + scrollValue); 

// Keep updating the value of the scroll position in the variable
// when a user scrolls it will be updated.
jQuery(window).scroll(
  function()
  {
	let scrollValue = jQuery(window).scrollTop();
	console.log('Scroll value: ' + scrollValue);    
  }
);
 
PREVIOUS NEXT
Tagged: #scroll #position #jQuery
ADD COMMENT
Topic
Name
3+6 =