Return whether the user scrolls in or out (along the z-axis):
function myFunction(event) {
var z = event.deltaZ;
}
Try it Yourself »
The deltaZ
property returns a positive value when scrolling in, and a negative value when scrolling out, otherwise 0.
Note: Most mouse devices do not have the ability to scroll along the z-axis, and will always return 0.
Note: This property is read-only.
event.deltaZ
Return Value: | A Double, indicating the scrolling direction of the mouse wheel |
---|
HTML DOM reference: WheelEvent deltaY Property
HTML DOM reference: WheelEvent deltaX Property
event.deltaZ
is a DOM Level 4 (2015) feature.
It is supported in all modern browsers:
Chrome | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes |
event.deltaZ
is not supported in Internet Explorer 11 (or earlier).
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!