WheelEvent deltaX Property
Definition and Usage
The deltaX property returns a positive value when scrolling to the right, a negative value when scrolling to the left, and 0 otherwise.
Note:Most mouse devices do not have the ability to scroll left and right, and always return 0.
Note:This property is read-only.
Example
Return whether the user is scrolling to the left or right:
function myFunction(event) { var x = event.deltaX; }
Grammar
event.deltaX
Technical Details
Return Value: | A double type value representing the scrolling direction of the mouse wheel. |
---|
Browser Support
Property | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
deltaX | 31 | Supported | 17 | Not Supported | 18 |
Related Pages
HTML DOM Reference Manual:WheelEvent deltaY Property