|
2 | 2 |
|
3 | 3 | A jQuery plugin that adds cross-browser mouse wheel support.
|
4 | 4 |
|
5 |
| -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. |
| 5 | +In order to use the plugin, simply bind the `mousewheel` event to an element. |
| 6 | +It also provides two helper methods called `mousewheel` and `unmousewheel` |
| 7 | +that act just like other event helper methods in jQuery. The event callback |
| 8 | +receives three extra arguments which are the normalized "deltas" of the mouse wheel. |
6 | 9 |
|
7 | 10 | Here is an example of using both the bind and helper method syntax.
|
8 | 11 |
|
9 |
| - // using bind |
10 |
| - $('#my_elem').bind('mousewheel', function(event, delta, deltaX, deltaY) { |
11 |
| - console.log(delta, deltaX, deltaY); |
12 |
| - }); |
| 12 | +```js |
| 13 | +// using bind |
| 14 | +$('#my_elem').bind('mousewheel', function(event, delta, deltaX, deltaY) { |
| 15 | + console.log(delta, deltaX, deltaY); |
| 16 | +}); |
13 | 17 |
|
14 |
| - // using the event helper |
15 |
| - $('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) { |
16 |
| - console.log(delta, deltaX, deltaY); |
17 |
| - }); |
| 18 | +// using the event helper |
| 19 | +$('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) { |
| 20 | + console.log(delta, deltaX, deltaY); |
| 21 | +}); |
| 22 | +``` |
18 | 23 |
|
19 | 24 |
|
20 | 25 | ## License
|
21 | 26 |
|
22 |
| -This plugin is licensed under the MIT License (LICENSE.txt). |
| 27 | +This plugin is licensed under the [MIT License](LICENSE.txt). |
23 | 28 |
|
24 | 29 | Copyright (c) 2013 [Brandon Aaron](http://brandonaaron.net)
|
0 commit comments