Skip to content
Related Articles

Related Articles

HTML | DOM WheelEvent deltaY Property

View Discussion
Improve Article
Save Article
  • Last Updated : 11 Jul, 2022

The WheelEvent.deltaY property in HTML is used to return a positive double value when the web page is scrolled down, and a negative double value when the page is scrolled up, else it returns zero. It is a read-only property.



Return Value: It returns a double value which indicates the scrolling direction of the mouse wheel.

  • A positive double value represents mouse is scrolled down.
  • A negative double value represents mouse is scrolled up.



<!DOCTYPE html>
        <title>DOM WheelEvent deltaY Property</title>
    <body onwheel="Geeks(event)"
          style="text-align:center; height: 5000px;">
    <h1 style="color: green;">
        DOM WheelEvent deltaY Property
    <p>Scroll to see effect:</p>
    <p id="p"></p>
        function Geeks(event) {
            var doc = event.deltaY;
            document.getElementById("p").innerHTML = doc;



Supported Browsers: The browser supported by deltaY property are listed below:

  • Apple Safari 8.0
  • Google Chrome 31.0
  • Edge 12.0
  • Firefox 17.0
  • Opera 18.0
  • Internet Explorer 9.0
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!