@@ -177,11 +177,11 @@ <h1 id="packageName">jQuery Mousewheel</h1>
177
177
< h1 > jQuery Mouse Wheel Plugin</ h1 >
178
178
< p > A < a href ="http://jquery.com/ "> jQuery</ a > plugin that adds cross-browser mouse wheel support with delta normalization.</ p >
179
179
< p > In order to use the plugin, simply bind the < code > mousewheel</ code > event to an element.</ p >
180
- < p > It also provides two helper methods called < code > mousewheel</ code > and < code > unmousewheel</ code >
180
+ < p > It also provides two helper methods called < code > mousewheel</ code > and < code > unmousewheel</ code > < br />
181
181
that act just like other event helper methods in jQuery.</ p >
182
- < p > The event object is updated with the normalized < code > deltaX</ code > and < code > deltaY</ code > properties.
183
- In addition there is a new property on the event object called < code > deltaFactor</ code > . Multiply
184
- the < code > deltaFactor</ code > by < code > deltaX</ code > or < code > deltaY</ code > to get the scroll distance that the browser
182
+ < p > The event object is updated with the normalized < code > deltaX</ code > and < code > deltaY</ code > properties.< br />
183
+ In addition there is a new property on the event object called < code > deltaFactor</ code > . Multiply< br />
184
+ the < code > deltaFactor</ code > by < code > deltaX</ code > or < code > deltaY</ code > to get the scroll distance that the browser< br />
185
185
has reported.</ p >
186
186
< p > Here is an example of using both the bind and helper method syntax:</ p >
187
187
< pre class ="prettyprint linenums lang-language "> < code > // using on
@@ -193,28 +193,28 @@ <h1>jQuery Mouse Wheel Plugin</h1>
193
193
$('#my_elem').mousewheel(function(event) {
194
194
console.log(event.deltaX, event.deltaY, event.deltaFactor);
195
195
});</ code > </ pre >
196
- < p > The old behavior of adding three arguments (< code > delta</ code > , < code > deltaX</ code > , and < code > deltaY</ code > ) to the
196
+ < p > The old behavior of adding three arguments (< code > delta</ code > , < code > deltaX</ code > , and < code > deltaY</ code > ) to the< br />
197
197
event handler is now deprecated and will be removed in later releases.</ p >
198
198
< h2 > The Deltas...</ h2 >
199
- < p > The combination of browsers, operating systems, and devices offer a huge range of possible delta values. In fact if the user
200
- uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
201
- values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
202
- acceleration that is used. This number has the potential to be in the thousands depending on the device.
199
+ < p > The combination of browsers, operating systems, and devices offer a huge range of possible delta values. In fact if the user< br />
200
+ uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those< br />
201
+ values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or< br />
202
+ acceleration that is used. This number has the potential to be in the thousands depending on the device.< br />
203
203
Check out some of the data collected from users < a href ="http://mousewheeldatacollector.herokuapp.com/ "> here</ a > .</ p >
204
204
< h3 > Getting the scroll distance</ h3 >
205
- < p > In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
206
- scroll based on the users input. This can be done by multiplying the < code > deltaFactor</ code > by the < code > deltaX</ code > or < code > deltaY</ code >
205
+ < p > In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should< br />
206
+ scroll based on the users input. This can be done by multiplying the < code > deltaFactor</ code > by the < code > deltaX</ code > or < code > deltaY</ code > < br />
207
207
event property to find the scroll distance the browser reported.</ p >
208
- < p > The < code > deltaFactor</ code > property was added to the event object in 3.1.5 so that the actual reported delta value can be
208
+ < p > The < code > deltaFactor</ code > property was added to the event object in 3.1.5 so that the actual reported delta value can be< br />
209
209
extracted. This is a non-standard property.</ p >
210
210
< h2 > Building the code in the repo</ h2 >
211
211
< pre class ="prettyprint linenums lang-language "> < code > $ git clone git@github.com:jquery/jquery-mousewheel.git
212
212
$ cd jquery-mousewheel/
213
213
$ npm install
214
214
$ npm run build
215
215
$ npm run karma</ code > </ pre >
216
- < p > The unit tests run by karma are < em > very</ em > basic sanity checks; improvements welcome.
217
- To fully test the plugin, load < a href ="test/index.html "> test/index.html</ a > in each supported
216
+ < p > The unit tests run by karma are < em > very</ em > basic sanity checks; improvements welcome.< br />
217
+ To fully test the plugin, load < a href ="test/index.html "> test/index.html</ a > in each supported< br />
218
218
browser and follow the instructions at the top of the file after the unit tests finish.</ p >
219
219
</ div >
220
220
0 commit comments