2008-10-15 20:35:05 -05:00
|
|
|
# jQuery Mouse Wheel Plugin
|
|
|
|
|
|
|
|
A jQuery plugin that adds cross-browser mouse wheel support.
|
|
|
|
|
2013-02-24 12:38:36 +02:00
|
|
|
In order to use the plugin, simply bind the `mousewheel` event to an element.
|
|
|
|
It also provides two helper methods called `mousewheel` and `unmousewheel`
|
|
|
|
that act just like other event helper methods in jQuery. The event callback
|
|
|
|
receives three extra arguments which are the normalized "deltas" of the mouse wheel.
|
2010-02-12 17:05:51 -06:00
|
|
|
|
|
|
|
Here is an example of using both the bind and helper method syntax.
|
|
|
|
|
2013-02-24 12:38:36 +02:00
|
|
|
```js
|
|
|
|
// using bind
|
|
|
|
$('#my_elem').bind('mousewheel', function(event, delta, deltaX, deltaY) {
|
|
|
|
console.log(delta, deltaX, deltaY);
|
|
|
|
});
|
2013-02-22 09:48:58 -06:00
|
|
|
|
2013-02-24 12:38:36 +02:00
|
|
|
// using the event helper
|
|
|
|
$('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) {
|
|
|
|
console.log(delta, deltaX, deltaY);
|
|
|
|
});
|
|
|
|
```
|
2010-02-12 17:05:51 -06:00
|
|
|
|
2012-08-20 13:04:55 -05:00
|
|
|
## See it in action
|
|
|
|
[See the tests on Github](http://brandonaaron.github.com/jquery-mousewheel/test) or navigate to `test/index.html` in your browser.
|
2008-10-15 20:35:05 -05:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
2013-02-24 12:38:36 +02:00
|
|
|
This plugin is licensed under the [MIT License](LICENSE.txt).
|
2008-10-15 20:35:05 -05:00
|
|
|
|
2013-02-22 09:48:58 -06:00
|
|
|
Copyright (c) 2013 [Brandon Aaron](http://brandonaaron.net)
|