Skip to content

Commit

Permalink
Updating README with deltaX and deltaY info
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonaaron committed Aug 23, 2010
1 parent 8b9dcb7 commit 234889f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

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

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.
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.

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

// using bind
$('#my_elem').bind('mousewheel', function(event, delta) {
console.log(delta);
$('#my_elem').bind('mousewheel', function(event, delta, deltaX, deltaY) {
console.log(delta, deltaX, deltaY);
});

// using the event helper
$('#my_elem').mousewheel(function(event, delta) {
console.log(delta);
$('#my_elem').mousewheel(function(event, delta, deltaX, deltaY) {
console.log(delta, deltaX, deltaY);
});


Expand Down

0 comments on commit 234889f

Please sign in to comment.