WheelEvent deltaMode property

Definition and usage

The deltaMode property returns a numeric value representing the length unit of the scroll value (deltaX,deltaY and deltaZThe length unit of (

  • 0 = Pixel
  • 1 = Line
  • 2 = Page

Note:This property is read-only.

Example

Return the length unit of the delta value:

function myFunction(event) {
  var x = event.deltaMode;
  // 0 = pixels
  // 1 = lines
  // 2 = pages
}

Try it yourself

Syntax

event.deltaMode

Technical details

Return value:

Numeric value indicating the length unit of the delta value.

Possible values:

  • 0 = Pixel
  • 1 = Line
  • 2 = Page

Browser Support

Properties Chrome IE Firefox Safari Opera
deltaMode 31 Supported 17 Not Supported 18

Related Pages

HTML DOM Reference Manual:WheelEvent deltaX Property

HTML DOM Reference Manual:WheelEvent deltaY Property

HTML DOM Reference Manual:WheelEvent deltaZ Property