jQuery WheelEvent Plugin. Add cross-browser support mouse wheel event
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
LICENSE.txt
README.md
jquery-1.9.1.js
jquery.wheelevent.js
wheelevent.jquery.json

README.md

jQuery WheelEvent Plugin

Plugin for cross-browser add mouse wheel event handler to any DOM element.

About wheel event: MDN

Usage

You can add handler through jquery on methods.

 $('.class').on('wheel', handler)

Or use short plugin methods.

 $('.class').wheel(handler)

Standardized event passed to handler have properties deltaX, deltaY, deltaZ, deltaMode.

 $('.class').on('wheel', function(event) {
 // get scroll line or pixel.
 var delta = event.deltaY;
 if (delta > 0) {
 // do something if wheel scroll up
 } else {
  // do something if wheel scroll down
 }
 });

Compatibility

Tested with jQuery 1.9.1 and next browser on Windows

  • IE 7/8/9
  • Chrome 24.0
  • Opera 12.14
  • Safari 5.1.7
  • Firefox 17

Please tell about find issue with other browser or platform.