Created
May 8, 2015 07:56
-
-
Save likerRr/f2886e226db595912ebb to your computer and use it in GitHub Desktop.
jQuery horizontal scroll
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
$('#el').bind('DOMMouseScroll mousewheel', function(e) { | |
var step = 30; | |
e.preventDefault(); | |
step *= (e.originalEvent.wheelDelta > 0) ? -1 : 1; | |
$(this).scrollLeft($(this).scrollLeft() + step); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment