Firefox Tomorrow

web api event

Element: MozMousePixelScroll event

View on MDN ↗

The Firefox-only, non-standard, and obsolete MozMousePixelScroll event is fired at an Element asynchronously when a mouse wheel or similar device is operated. It’s represented by the MouseScrollEvent interface.

[!NOTE] Do not use this non-standard and obsolete event. Instead, you should always use the standard wheel event.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("MozMousePixelScroll", (event) => { })

onMozMousePixelScroll = (event) => { }

Event type

A WheelEvent. Inherits from MouseEvent, UIEvent and Event.

Getting the distance scrolled

The event’s detail property indicates the scroll distance in terms of lines, with negative values indicating the scrolling movement is either toward the bottom or toward the right, and positive values indicating scrolling to the top or left.

If the platform’s native mouse wheel events indicate the scroll distance in terms of lines or pages, the value of detail is computed using that value and the line height or page width/height of the nearest ancestor scrollable element that contains the target element.

[!NOTE] On macOS, the scroll distance (and therefore the value of detail) is computed based on the accelerated scroll distance.

The value of detail is never 0 if the events are legitimate.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also

  • MouseScrollEvent
  • Gecko’s legacy line or page scroll event: DOMMouseScroll
  • Non-Gecko browsers’ legacy mouse wheel event: mousewheel
  • Standardized wheel event: wheel