Element: MozMousePixelScroll event
UI Events
UI Events
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 addEventListener():
```js-nolint
addEventListener("MozMousePixelScroll", (event) => { })
```
Alternatively, assign to the [event handler property](/docs/Web/API/Document_Object_Model/Events#using_onevent_properties) of the interface:
```js-nolint
onMozMousePixelScroll = (event) => { }
```
## Event type
A WheelEvent. Inherits from MouseEvent, UIEvent and Event.
WheelEvent
## 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
## See also
- MouseScrollEvent
- Gecko's legacy line or page scroll event: `DOMMouseScroll`
- Non-Gecko browsers' legacy mouse wheel event: `mousewheel`
- Standardized wheel event: `wheel`
Cite this
"Element: MozMousePixelScroll event". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/Element/MozMousePixelScroll_event JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy