WheelEvent() constructor returns a newly created WheelEvent 对象。

句法

var wheelEvent = new WheelEvent(typeArg, wheelEventInit);
					

特性

typeArg
DOMString 表示事件的名称。
wheelEventInit 可选
WheelEventInit 字典,拥有以下字段:
  • "deltaX" , optional and defaulting to 0.0 ,是 double representing the horizontal scroll amount in the deltaMode unit.
  • "deltaY" , optional and defaulting to 0.0 ,是 double representing the vertical scroll amount in the deltaMode unit.
  • "deltaZ" , optional and defaulting to 0.0 ,是 double representing the scroll amount for the z-axis in the deltaMode unit.
  • "deltaMode" , optional and defaulting to 0 ,是 unsigned long representing the unit of the delta values scroll amount. Permitted values are:
    常量 描述
    DOM_DELTA_PIXEL 0x00 The delta values are specified in pixels.
    DOM_DELTA_LINE 0x01 The delta values are specified in lines.
    DOM_DELTA_PAGE 0x02 The delta values are specified in pages.

WheelEventInit 字典还接受字段来自 MouseEventInit , UIEventInit and EventInit 字典。

规范

规范 状态 注释
DOM (文档对象模型) 3 级事件规范
The definition of 'WheelEvent()' in that specification.
过时 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
WheelEvent() 构造函数 Chrome Yes Edge ≤18 Firefox 17 IE No Opera Yes Safari 6.1 WebView Android Yes Chrome Android Yes Firefox Android 17 Opera Android Yes Safari iOS No Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

另请参阅

元数据

  • 最后修改: