WheelEvent.deltaX

WheelEvent.deltaX 只读属性是一个 double 类型值,声明水平滚动量以WheelEvent.deltaMode 为单位。

语法

var dX = event.deltaX;

例子

js

var syntheticEvent = new WheelEvent("syntheticWheel", {
  deltaX: 4,
  deltaMode: 0,
});

console.log(syntheticEvent.deltaX);

规范

Specification
UI Events
# dom-wheelevent-deltax

浏览器兼容性

BCD tables only load in the browser

另见