Skip to content

Commit adf892d

Browse files
committed
update the readme with more information about the deltas
1 parent aa8b08e commit adf892d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,24 @@ The old behavior of adding three arguments (`delta`, `deltaX`, and `deltaY`) to
3030
event handler is now deprecated and will be removed in later releases.
3131

3232

33+
## The Deltas...
34+
35+
The combination of Browsers, Operating Systems, and Devices offer a huge range of possible delta values. In fact if the user
36+
uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
37+
values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
38+
acceleration that is used. This number has the potential to be in the thousands depending on the device.
39+
Check out some of the data collected from users [here](http://mousewheeldatacollector.herokuapp.com/).
40+
41+
### Getting the scroll distance
42+
43+
In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
44+
scroll based on the users input. This can be done by multiplying the `deltaFactor` by the `deltaX` or `deltaY`
45+
event property to find the scroll distance the browser reported.
46+
47+
The `deltaFactor` property was added to the event object in 3.1.5 so that the actual reported delta value can be
48+
extracted. This is a non-standard property.
49+
50+
3351
## See it in action
3452
[See the tests on Github](http://brandonaaron.github.io/jquery-mousewheel/test).
3553

0 commit comments

Comments
 (0)