Skip to content

Commit 234889f

Browse files
committed
Updating README with deltaX and deltaY info
1 parent 8b9dcb7 commit 234889f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
A jQuery plugin that adds cross-browser mouse wheel support.
44

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 an extra argument which is the normalized "delta" of the mouse wheel.
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.
66

77
Here is an example of using both the bind and helper method syntax.
88

99
// using bind
10-
$('#my_elem').bind('mousewheel', function(event, delta) {
11-
console.log(delta);
10+
$('#my_elem').bind('mousewheel', function(event, delta, deltaX, deltaY) {
11+
console.log(delta, deltaX, deltaY);
1212
});
1313

1414
// using the event helper
15-
$('#my_elem').mousewheel(function(event, delta) {
16-
console.log(delta);
15+
$('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) {
16+
console.log(delta, deltaX, deltaY);
1717
});
1818

1919

0 commit comments

Comments
 (0)