Created
September 19, 2013 14:50
-
-
Save scodx/6624645 to your computer and use it in GitHub Desktop.
detect horizontal scroll in js
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 lastScrollLeft = 0; | |
$(window).scroll(function() { | |
var documentScrollLeft = $(document).scrollLeft(); | |
if (lastScrollLeft != documentScrollLeft) { | |
console.log('scroll x'); | |
lastScrollLeft = documentScrollLeft; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment