Skip to content
Related Articles

Related Articles

Improve Article

HTML | DOM WheelEvent deltaX Property

  • Last Updated : 17 Jan, 2019

The WheelEvent.deltaX property in HTML is used to return a positive double value when the web page is scrolled horizontally along left or right direction. If the page is scrolled to right it return a positive value, and a negative double value when scrolled to the left, else it returns zero. It is a read-only property.



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

  • A positive double value represents mouse is scrolled to right.
  • A negative double value represents mouse is scrolled to left.


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

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

  • Apple Safari Not supported
  • Google Chrome 31.0
  • Firefox 17.0
  • Opera 18.0
  • Internet Explorer

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :