Created
April 24, 2012 06:22
-
-
Save iegik/2477085 to your computer and use it in GitHub Desktop.
Binding mouseweel event
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
| /* | |
| adds events to the mouse and left / right keys | |
| http://brandonaaron.net/code/mousewheel/docs | |
| */ | |
| $(document).bind('mousewheel', function(e, delta) { | |
| if(delta > 0) { | |
| stopSlideshow(); | |
| rotateImages(0); | |
| } | |
| else { | |
| stopSlideshow(); | |
| rotateImages(1); | |
| } | |
| return false; | |
| }).keydown(function(e){ | |
| switch(e.which){ | |
| case 37: | |
| stopSlideshow(); | |
| rotateImages(0); | |
| break; | |
| case 39: | |
| stopSlideshow(); | |
| rotateImages(1); | |
| break; | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment