Last active
December 17, 2015 11:09
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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