Created
May 20, 2018 07:58
-
-
Save vladanyes/c71e3d82294f22c5223e62a26288c55b to your computer and use it in GitHub Desktop.
Scroll direction
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 lastScrollTop = 0; | |
$(window).on('scroll', function() { | |
st = $(this).scrollTop(); | |
if(st < lastScrollTop) { | |
console.log('up 1'); | |
} | |
else { | |
console.log('down 1'); | |
// getImages(); | |
} | |
lastScrollTop = st; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment