Skip to content

Instantly share code, notes, and snippets.

@iegik
Created April 24, 2012 06:22
Show Gist options
  • Select an option

  • Save iegik/2477085 to your computer and use it in GitHub Desktop.

Select an option

Save iegik/2477085 to your computer and use it in GitHub Desktop.
Binding mouseweel event
/*
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