JavaScript Element MozMousePixelScroll Event

Beginner
5 min read
Updated: Nov 2026
3 examples
Event

Definition

In JavaScript, the Firefox-only, obsolete MozMousePixelScroll event fires asynchronously when a mouse wheel or similar device is operated (MDN). Prefer the standard wheel event.

Register a listener with addEventListener. Check readiness and browser support before you rely on this event.

Syntax

Listen for MozMousePixelScroll. Start with this line.

JavaScript
addEventListener("MozMousePixelScroll", fn)
CallWhat it does
addEventListener("MozMousePixelScroll", fn)Primary signature.

Built into the browser. Listen with el.addEventListener("MozMousePixelScroll", …) — no import required.

Library declarations
JavaScript
addEventListener("MozMousePixelScroll", fn)

Parameters

ParameterDescription
Handler propOptional. onMozMousePixelScroll

Return Value

Return ValueDescription
*Fires as an Element event (listener receives the Event object).

JavaScript Examples

Example 1 — Legacy MozMousePixelScroll Log

Study-only: see if the obsolete Firefox event fires in your browser.

JavaScript
const stage = document.getElementById("stage");

stage.addEventListener("MozMousePixelScroll", (event) => {
  console.log("MozMousePixelScroll detail=" + event.detail);
});

// May stay silent outside Firefox (MDN)
Try It Yourself

How It Works

  1. Legacy name. Deprecated · Non-standard — not for new projects.
  2. Firefox only. Other engines never implemented it (MDN).
  3. detail. Direction/amount in Gecko’s legacy model.
  4. Next step. Replace with wheel in real apps.

Example 2 — Prefer Standard wheel

MDN replacement: log deltaY / deltaX / deltaMode.

JavaScript
const stage = document.getElementById("stage");

stage.addEventListener("wheel", (event) => {
  console.log(
    "wheel deltaY=" + event.deltaY,
    "deltaX=" + event.deltaX,
    "mode=" + event.deltaMode
  );
});
Try It Yourself

How It Works

  1. Standard event. Portable across modern browsers.
  2. deltaY / deltaX. Prefer these over legacy detail.
  3. deltaMode. Pixels, lines, or pages.
  4. Learn more. Full tutorial: wheel.

Example 3 — Prefer wheel, Log Legacy for Study

Always listen for wheel; optionally log Moz only while reading old Firefox code.

JavaScript
const stage = document.getElementById("stage");

function onScrollGesture(event, source) {
  if (source === "wheel") {
    console.log("wheel dy=" + event.deltaY);
    return;
  }
  console.log("MozMousePixelScroll detail=" + event.detail);
}

stage.addEventListener("wheel", (event) => onScrollGesture(event, "wheel"));
stage.addEventListener("MozMousePixelScroll", (event) =>
  onScrollGesture(event, "MozMousePixelScroll")
);
Try It Yourself

How It Works

  1. Primary path. wheel runs everywhere students build today.
  2. Optional legacy. Moz may also fire in old Firefox — for study only.
  3. Do not depend on Moz. Outside Gecko it stays silent.
  4. Ship only wheel in production code.

Browser Support

Element MozMousePixelScroll is Deprecated and Non-standard on MDN (Firefox/Gecko history). Do not add it to new code — migrate to wheel.

✓ Deprecated · Non-standard

Element MozMousePixelScroll

Obsolete Firefox-only wheel event. Prefer the standard wheel event with deltaX / deltaY.

Legacy Deprecated
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Android WebView Supported · Modern WebView
Full support
MozMousePixelScroll Avoid

Bottom line: Historical Firefox only. Use wheel for portable apps.

Frequently Asked Questions

It is a Firefox-only, obsolete, non-standard event fired asynchronously when a mouse wheel or similar device is operated. MDN marks it Deprecated and Non-standard. Prefer the standard wheel event.
No. Use addEventListener("wheel", …) with WheelEvent.deltaX / deltaY / deltaMode. MozMousePixelScroll was never a portable web standard.
Both are legacy Gecko scroll events. DOMMouseScroll was oriented around line/page accumulation; MozMousePixelScroll was Gecko’s finer pixel-oriented companion. Neither should be used in new code.
Per MDN: negative detail means scrolling toward the bottom or right; positive means toward the top or left. Trusted events never use detail 0. Prefer wheel’s deltaY / deltaX instead.
Historically Firefox (Gecko) only. Chrome, Safari, Edge, and other engines do not implement this Mozilla-prefixed event.
MDN lists WheelEvent (inherits from MouseEvent, UIEvent, and Event). Older docs also mention the MouseScrollEvent interface name.

Next: paste

Learn the Element event that fires when the user pastes content.

paste tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful