WheelEvent:deltaMode 属性
WheelEvent.deltaMode
只读属性返回 unsigned long
,表示滚动量的 delta 值的单位。允许的值为:
常量 | 值 | 描述 |
---|---|---|
DOM_DELTA_PIXEL |
0x00 |
delta 值以像素为单位。 |
DOM_DELTA_LINE |
0x01 |
delta 值以行为单位。 |
DOM_DELTA_PAGE |
0x02 |
delta 值以页为单位。 |
值
unsigned long
。
示例
js
const syntheticEvent = new WheelEvent("syntheticWheel", {
deltaX: 4,
deltaMode: 0,
});
console.log(syntheticEvent.deltaMode);
规范
Specification |
---|
UI Events # dom-wheelevent-deltamode |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
deltaMode |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.