Skip to content

Instantly share code, notes, and snippets.

@seanrose
Last active December 17, 2015 11:09
Show Gist options
  • Save seanrose/5600393 to your computer and use it in GitHub Desktop.
Save seanrose/5600393 to your computer and use it in GitHub Desktop.
Using JQuery to dynamically monitor the scroll bar/scroll position on a page.
// The JQuery scroll() function sets up a listener for scrolling on the selector you pass to it.
$( document ).scroll( function() {
// scrollTop gets the # of pixels from the top of the page
console.log( $( this ).scrollTop() );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment