Created
September 30, 2010 17:23
-
-
Save amiel/604951 to your computer and use it in GitHub Desktop.
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
var mousewheel_handler = (function() { | |
var threshold = 0.75, | |
scrolled_amount = 0; | |
return function(e, delta, deltaX, deltaY) { | |
scrolled_amount += deltaY; | |
if (scrolled_amount > threshold) { | |
move.up(); | |
scrolled_amount = 0; | |
} else if (scrolled_amount < -threshold) { | |
move.down(); | |
scrolled_amount = 0; | |
} | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment