HTML | DOM WheelEvent Last Updated : 16 Oct, 2019 Comments Improve Suggest changes Like Article Like Report The DOM WheelEvent contains the events that happen whenever a scroll is detected. It can be used to find out the scroll direction, amount and mode of scroll. It has the onwheel event that is called whenever scrolling takes place. Properties: deltaX: It returns the amount of horizontal scroll of the mouse wheel i.e. on the x-axis. deltaY: It returns the amount of vertical scroll of the mouse wheel i.e. on the y-axis. deltaZ: It returns the amount of scroll on the z-axis of the mouse wheel. deltaMode: It returns the unit of measurement that is used for the delta values. This value may be in pixels, lines or pages. Example: This example displays the scroll properties. html <!DOCTYPE html> <html> <head> <title>HTML DOM WheelEvent</title> <style> .area { height: 200px; width: 200px; border: 5px solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b>HTML | DOM WheelEvent</b> <p> Try scrolling on the element below to check the scroll properties. </p> <div class="area" onwheel="isScrolling(event)"> </div> <script type="text/javascript"> function isScrolling(event) { console.log("X scroll direction:", event.deltaX); console.log("Y scroll direction:", event.deltaY); console.log("Z scroll direction:", event.deltaZ); console.log("Scroll Mode is:", event.deltaMode); } </script> </body> </html> Output: Before scrolling the div element: Console Output after scrolling the div element: Event Types: onwheel: This event occurs whenever the mouse wheel is scrolled up or down on the element. Example: This example illustrates the onwheel event. html <!DOCTYPE html> <html> <head> <title>onwheel event type</title> <style> .area { height: 200px; width: 200px; border: 5px solid; } </style> </head> <body> <h1 style="color: green"> GeeksforGeeks </h1> <b>HTML | DOM WheelEvent</b> <p> Try scrolling on the element below to call the onwheel function. </p> <div class="area" onwheel="isScrolling()"> </div> <script type="text/javascript"> function isScrolling() { console.log('You are scrolling" + " in the element.') } </script> </body> </html> Output: Before scrolling the div element: Console output after scrolling the div element: Supported Browsers: The browser supported by HTML DOM WheelEvent are listed below: Google Chrome 31 Internet Explorer 9 Firefox 17 Apple Safari Opera 18 Comment More infoAdvertise with us Next Article HTML | DOM WheelEvent S sayantanm19 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM UiEvent The DOM UiEvent in HTML is an event that is triggered by the user interface belonging to the UiEvent Object. The two main purposes of the UI Event are: Allows registration of event listeners and describes event flow through a tree structure.Provide a common subset of the current event systems used i 2 min read HTML DOM MouseEvent The MouseEvent Object handles events that occur when the mouse interacts with the HTML document. There are lots of events that interacts with the HTML document. Mouse Events: Mouse events are the action taken by the user on the web page, like clicking, hovering over, etc. Mouse Events Description on 3 min read HTML | DOM TouchEvent When a user touches a touch-based device the resulted events are handled by TouchEvent Object. The touch events consist of three types of interfaces i.e. Touch, TouchEvent and TouchList. The single contact point events on a touch-sensitive device are handled by the Touch interface. The events which 2 min read HTML | DOM KeyboardEvent It refers to the events which occur when a key is pressed on the keyboard. Syntax: <input type="text" onkeypress/onkeydown/onkeyup="function()/event"> Events:The following events occur on pressing a key- onkeydownonkeypressonkeyup Properties: altKey: It returns if alt key was pressed or not.ch 3 min read HTML | DOM WheelEvent deltaY Property 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, or else it returns zero. It is a read-only property. Syntax: event.deltaY Return Value: It returns a double value which indic 1 min read Like