JavaScript Element MozMousePixelScroll Event

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Deprecated
Non-standard
Instance event

What You’ll Learn

The MozMousePixelScroll event is a Firefox-only scroll signal. Learn why it is Deprecated and Non-standard, how detail encodes direction, how it relates to DOMMouseScroll / mousewheel, and how to migrate to the standard wheel event—with five examples and try-it labs.

01

Kind

Instance event

02

Type

WheelEvent

03

When

Wheel operated

04

Handler

onMozMousePixelScroll

05

Status

Deprecated · Non-standard

06

Modern path

wheel event

Introduction

Before the web standardized on wheel, Firefox shipped several proprietary scroll events. MozMousePixelScroll was the Mozilla-prefixed, pixel-oriented companion to line/page-oriented DOMMouseScroll.

MDN’s guidance is direct: do not use this obsolete event. Always prefer the standard wheel event for portable scroll, zoom, and custom-scroller logic.

💡
Beginner tip

In Chrome, Safari, Edge, and most modern environments, a MozMousePixelScroll listener never runs. Labs below also attach wheel so you still learn a useful API.

Understanding MozMousePixelScroll

An instance event (legacy) that answered: “Did a mouse wheel or similar device operate over this element (Firefox path)?”

  • Deprecated & Non-standard on MDN — avoid in new projects.
  • Firefox-only historically — Mozilla-prefixed, not Chromium / WebKit.
  • WheelEvent (MDN) — older docs also mention MouseScrollEvent.
  • Listen with addEventListener("MozMousePixelScroll", ...) or onMozMousePixelScroll.
  • Replacement — the standardized wheel event.

📝 Syntax

Legacy listeners used the event name with addEventListener, or the handler property:

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

onMozMousePixelScroll = (event) => { };

Prefer this instead

JavaScript
addEventListener("wheel", (event) => {
  // event.deltaY, event.deltaX, event.deltaMode
});

Event type

A WheelEvent (inherits from MouseEvent, UIEvent, and Event). Legacy Gecko docs may also mention MouseScrollEvent.

Notable property: detail

Value ideaMeaning (per MDN)
Negative detailScrolling toward the bottom or right
Positive detailScrolling toward the top or left
0Trusted events never use 0 for detail
Platform notesOn macOS, distance can use accelerated scroll; line/page native units may be converted using a scrollable ancestor
⚠️
Sign convention differs from some siblings

Do not mix detail sign rules across legacy events. Prefer wheel’s deltaY / deltaX so direction is consistent.

⚡ When MozMousePixelScroll Fired

  • A mouse wheel or similar device was operated (asynchronously) on supporting Firefox builds.
  • It could fire repeatedly during continuous scrolling.
  • Outside Firefox it did not fire—so it failed as a cross-browser API.

⚡ Quick Reference

GoalCode / note
Listen (legacy Firefox)el.addEventListener("MozMousePixelScroll", fn)
Handler propertyel.onMozMousePixelScroll = fn
Read direction (MDN)Negative detail → bottom/right · positive → top/left
Modern replacementel.addEventListener("wheel", fn)
Modern deltasevent.deltaY, event.deltaX, event.deltaMode
MDN statusDeprecated · Non-standard

🔍 At a Glance

Four facts to remember about MozMousePixelScroll.

Event type
WheelEvent

detail for distance

Means
wheel scroll

Firefox legacy

Status
deprecated

+ Non-standard

Replace with
wheel

Standard API

Examples Gallery

Examples follow MDN Element: MozMousePixelScroll event for learning and migration. Prefer wheel in production. Labs also attach wheel so they teach something useful outside Firefox.

📚 Getting Started (Legacy)

How old Firefox code listened—study only; do not copy into new apps.

Example 1 — addEventListener("MozMousePixelScroll")

Log event.detail when the Firefox legacy event fires.

JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");

box.addEventListener("MozMousePixelScroll", (event) => {
  out.textContent = "MozMousePixelScroll detail=" + event.detail;
});
Try It Yourself

How It Works

If the label never updates, your browser likely does not dispatch this event—use the wheel labs below.

Example 2 — onMozMousePixelScroll Property

Same idea using the event handler property form.

JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");

box.onMozMousePixelScroll = (event) => {
  out.textContent = "onMozMousePixelScroll detail=" + event.detail;
};
Try It Yourself

How It Works

Prefer addEventListener in real apps. The property form is shown because MDN documents it for this event.

📈 Detail, Standard wheel & Migration

Interpret detail, then ship the modern wheel API.

Example 3 — Interpret detail Direction

Map MDN’s sign rules to a friendly label (legacy Firefox only).

JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");

box.addEventListener("MozMousePixelScroll", (event) => {
  const dir =
    event.detail < 0
      ? "toward bottom/right"
      : "toward top/left";
  out.textContent = "detail=" + event.detail + " (" + dir + ")";
});
Try It Yourself

How It Works

Do not assume the same sign rules as DOMMouseScroll or wheel.deltaY without checking docs.

Example 4 — Prefer Standard wheel

The replacement API you should use in new projects.

JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");

box.addEventListener("wheel", (event) => {
  out.textContent =
    "wheel deltaY=" + event.deltaY +
    " deltaX=" + event.deltaX +
    " mode=" + event.deltaMode;
});
Try It Yourself

How It Works

deltaMode tells you whether deltas are in pixels (0), lines (1), or pages (2).

Example 5 — Migration Helper (wheel first)

Listen for wheel; only mention the legacy Firefox event for old codebases.

JavaScript
const box = document.getElementById("box");
const out = document.getElementById("out");

function onScrollGesture(event, source) {
  if (source === "wheel") {
    out.textContent = "wheel dy=" + event.deltaY;
    return;
  }
  // Legacy Firefox path — avoid in new apps
  out.textContent = "MozMousePixelScroll detail=" + event.detail;
}

box.addEventListener("wheel", (event) => onScrollGesture(event, "wheel"));

// Optional legacy listen (Firefox-only; usually unnecessary today)
box.addEventListener("MozMousePixelScroll", (event) =>
  onScrollGesture(event, "MozMousePixelScroll")
);
Try It Yourself

How It Works

New apps can omit the MozMousePixelScroll branch entirely and keep only wheel.

🚀 Common Use Cases

  • Reading or migrating legacy Firefox scroll / zoom handlers.
  • Teaching why Mozilla-prefixed events fail outside Gecko.
  • Comparing detail with standard deltaY.
  • Documenting a migration checklist alongside DOMMouseScroll / mousewheel.
  • Not recommended: building new scroll UX on MozMousePixelScroll.

🔧 How It Works

1

User scrolls

Mouse wheel or trackpad gesture begins over the element.

Input
2

Legacy Gecko path?

Old Firefox may dispatch MozMousePixelScroll / DOMMouseScroll.

Legacy
3

Standard wheel

Modern apps listen for wheel and read deltaX / deltaY / deltaMode.

Standard
4

Prefer wheel

Portable scrolling UX without Mozilla-prefixed events.

📝 Notes

Very Limited / Legacy Browser Support

MozMousePixelScroll is a deprecated, non-standard Firefox event. Logos use the shared browser-image-sprite.png sprite from this project. Other engines never implemented it. Prefer the standard wheel event everywhere.

Deprecated · Non-standard

Element MozMousePixelScroll

Do not build features on this event. Migrate listeners to wheel and deltaY / deltaX.

Legacy Not for new apps
Google Chrome Never implemented
Unavailable
Mozilla Firefox Legacy Gecko only · prefer wheel
Avoid
Apple Safari Never implemented
Unavailable
Microsoft Edge Never implemented (Chromium)
Unavailable
Opera Never implemented (Chromium)
Unavailable
Internet Explorer No MozMousePixelScroll support
Unavailable
MozMousePixelScroll Deprecated

Bottom line: Use wheel for portable scroll/zoom UX. Treat MozMousePixelScroll as legacy Firefox documentation only.

Conclusion

MozMousePixelScroll is a deprecated, Firefox-only footnote in the scroll-event story. Learn it to migrate old Gecko code; ship the standard wheel event instead.

Continue with paste, DOMMouseScroll, mousewheel, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Use addEventListener("wheel", …) for new scroll/zoom UX
  • Read deltaY / deltaX / deltaMode
  • Migrate Mozilla-prefixed scroll listeners when you touch old Firefox code
  • Feature-detect before relying on any legacy Gecko-only event
  • Prefer one portable API over mixing detail sign conventions

❌ Don’t

  • Build new features on MozMousePixelScroll
  • Assume Chrome or Safari ever fired this event
  • Mix detail rules casually with DOMMouseScroll / deltaY
  • Treat Mozilla-prefixed events as future-proof
  • Overwrite onMozMousePixelScroll if you still need multiple legacy listeners

Key Takeaways

Knowledge Unlocked

Five things to remember about MozMousePixelScroll

Obsolete Firefox scroll signal—prefer the standard wheel event.

5
Core concepts
⚠️02

Deprecated

avoid new use

Status
🚫03

Non-standard

Gecko only

Compat
📄04

detail

direction codes

Quirk
🎯05

Use wheel

deltaY path

Modern

❓ 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.
Did you know?

MDN groups MozMousePixelScroll with other obsolete scroll events: Gecko’s DOMMouseScroll, non-Gecko mousewheel, and the standardized wheel replacement. The “Moz” prefix is a reminder it was never meant to be a cross-browser API.

Next: paste

Learn the ClipboardEvent that fires when the user pastes.

paste →

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.

5 people found this page helpful