WheelEvent deltaMode Property
Example
Return the length unit of the delta values:
function myFunction(event) {
var x = event.deltaMode;
// 0
= pixels
// 1 = lines
// 2 = pages
}
Try it Yourself »
Definition and Usage
The deltaMode
property returns a number
representing the length unit of the scrolling values (deltaX
,
deltaY
, and
deltaZ
).
0 = pixels
1 = lines
2 = pages
Note: This property is read-only.
Browser Support
Property | |||||
---|---|---|---|---|---|
deltaMode | 31 | yes | 17 | Not supported | 18 |
Syntax
event.deltaMode
Technical Details
Return Value: |
A
Number, indicating the length unit of the delta values Possible values: 0 = pixels 1 = lines 2 = pages |
---|
Related Pages
HTML DOM reference: WheelEvent deltaX Property
HTML DOM reference: WheelEvent deltaY Property
HTML DOM reference: WheelEvent deltaZ Property