Created
June 24, 2016 10:00
-
-
Save AlexandroPerez/b503506e63bd0496120f0a5a5ef9fed8 to your computer and use it in GitHub Desktop.
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
// Event listener for scrolling up or down | |
// source: http://jsfiddle.net/jquerybyexample/ScQQr/ | |
var iScrollPos = 0; | |
$(window).scroll(function () { | |
var iCurScrollPos = $(this).scrollTop(); | |
if (iCurScrollPos > iScrollPos) { | |
console.log('down'); | |
} else { | |
console.log('up'); | |
} | |
iScrollPos = iCurScrollPos; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment