WheelEvent deltaZ Property

Example

Return whether the user scrolls in or out (along the z-axis):

function myFunction(event) {
  var z = event.deltaZ;
}
Try it Yourself »

Description

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.


Syntax

event.deltaZ

Technical Details

Return Value: A Double, indicating the scrolling direction of the mouse wheel

Related Pages

HTML DOM reference: WheelEvent deltaY Property

HTML DOM reference: WheelEvent deltaX Property


Browser Support

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).



Copyright 1999-2023 by Refsnes Data. All Rights Reserved.