WheelEvent.deltaY 只读属性是一个 double 类型值, 声明垂直滚动量以WheelEvent.deltaMode 为单位.

语法

var dY = event.deltaY;

例子

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

console.log(syntheticEvent.deltaY);

规范

Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
WheelEvent.deltaY
Obsolete Initial definition.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 31 (Yes) 17.0 (17.0) 9.0 [1] 18 9.0
Feature Android Edge Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support (Yes) (Yes) 17.0 (17.0) ? (Yes) 未实现

[1] IE9 支持一个规范的一个旧版本的草稿, 这里的值的类型是 long 而不是一个 double 类型的值.

另见

文档标签和贡献者

此页面的贡献者: Jiang-Xuan
最后编辑者: Jiang-Xuan,