Created
November 27, 2014 06:59
-
-
Save barlas/776cae956ef2185b63ed to your computer and use it in GitHub Desktop.
jQuery - Detecting user's scrolling down or up.
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
var currentScroll = 0; | |
$(window).scroll(function() { | |
var nextScroll = $(this).scrollTop(); | |
if ( nextScroll > currentScroll ) {// scroll down | |
}else{// scroll up | |
} | |
currentScroll = nextScroll; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment