Created
June 20, 2017 15:09
-
-
Save khripunovpp/38a5b5842c28cd5b43014b8f302d4236 to your computer and use it in GitHub Desktop.
scroll-direction
This file contains hidden or 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 scrollPos = 0; | |
$(window).scroll(function(){ | |
var st = $(this).scrollTop(); | |
if (st > scrollPos){ | |
$('#info').text('DOWN'); | |
} else { | |
$('#info').text('UP'); | |
} | |
scrollPos = st; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment