Skip to content

Instantly share code, notes, and snippets.

@remy
Created April 18, 2010 14:36
Show Gist options
  • Save remy/370248 to your computer and use it in GitHub Desktop.
Save remy/370248 to your computer and use it in GitHub Desktop.
Capture mousewheel event (jQuery)
// taken from http://html5readiness.com/script.js - cheers paul!
$(document).bind('DOMMouseScroll mousewheel', function(e, delta) {
delta = delta || e.detail || e.wheelDelta;
});
@zhang-ning
Copy link

if $ means jQuery ,please replace 'e' with 'e.originalEvent'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment