This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The WheelEvent.deltaX read-only property is a double representing the horizontal scroll amount in the WheelEvent.deltaMode unit.
You must check the deltaMode property to determine the unit of the deltaX value. Do not assume that the deltaX value is specified in pixels. Some browsers, for compatibility reasons, may return different units for the deltaX value depending on whether deltaMode has been accessed, to accommodate for websites not explicitly checking the deltaMode property.
A number.
const syntheticEvent = new WheelEvent("syntheticWheel", {
deltaX: 4,
deltaMode: 0,
});
console.log(syntheticEvent.deltaX);
| Specification |
|---|
| UI Events> # dom-wheelevent-deltax> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
deltaX |
31 | 12 | 17 | 18 | 8 | 31 | 17 | 18 | 8 | 2.0 | 4.4.3 | 8 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaX