Skip to content

Instantly share code, notes, and snippets.

@amiel
Created September 30, 2010 17:23
Show Gist options
  • Save amiel/604951 to your computer and use it in GitHub Desktop.
Save amiel/604951 to your computer and use it in GitHub Desktop.
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