HTML DOM WheelEvent deltaX Property

The HTML DOM WheelEvent deltaX property returns a signed number corresponding to whether user is scrolling left or right, if user is scrolling in any other direction this property returns 0.

Syntax

Following is the syntax −

Returning signed number

event.deltaX

Let us see an example of HTML DOM WheelEvent deltaX property −

Example



HTML DOM WheelEvent deltaX



   
     
         HTML-DOM-WheelEvent-deltaX          
                   
Scroll over div element
     
   
   

Output

Scrolling over div element in left direction −

Scrolling over div element in right direction −

Clicking reset button −

Updated on: 2021-12-21T08:47:05+05:30

189 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements