HTML | DOM WheelEvent deltaMode Property
The DOM WheelEvent deltaMode Property is used to returns a number Which represents the length unit of the scrolling values i.e deltaX, deltaY, deltaZ. It is read only Property.
It returns three numeric value that is:
- 0:stands for pixels
- 1: stands for lines
- 2: stands for pages
Syntax:
event.deltaMode
Return Value: It returns a numeric value which represents the length unit of the delta values.
Example:
<!DOCTYPE html> <html> <head> <title> DOM WheelEvent deltaMode Property </title> </head> <body onwheel="Geeks(event)" style="text-align: center; width: 1000px;"> <h1 style="color: green;"> GeeksforGeeks </h1> <h2> DOM WheelEvent deltaMode Property </h2> <p>Scroll to see effect:</p> <p id="p"></p> <script> function Geeks(event) { var doc = event.deltaMode; document.getElementById( "p").innerHTML = doc; } </script> </body> </html> |
Output:
Before Scroll:

After Scroll:

Supported Browsers: The browsers supported by DOM WheelEvent deltaMode Property are listed below:
- Google Chrome
- Internet Explorer
- Firefox
- Opera
Recommended Posts:
- HTML | DOM WheelEvent deltaZ Property
- HTML | DOM WheelEvent deltaX Property
- HTML | DOM WheelEvent deltaY Property
- HTML | DOM li value Property
- HTML | DOM Bdo dir Property
- HTML | DOM URL Property
- HTML | DOM id Property
- HTML | DOM value Property
- HTML | DOM specified Property
- HTML | DOM name Property
- HTML | DOM dir Property
- HTML | DOM Track src property
- HTML | DOM length Property
- HTML | DOM IFrame src Property
- HTML | DOM fullscreenElement Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



