Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Element
  4. MozMousePixelScroll

Element: MozMousePixelScroll event

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see thecompatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The Firefox-only,non-standard, andobsoleteMozMousePixelScroll event is fired at anElement asynchronously when a mouse wheel or similar device is operated. It's represented by theMouseScrollEvent interface.

Note:Do not use this non-standard and obsolete event. Instead, you should always use the standardwheel event.

Syntax

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

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

Event type

AWheelEvent. Inherits fromMouseEvent,UIEvent andEvent.

Event UIEvent MouseEvent WheelEvent

Getting the distance scrolled

The event'sdetail 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 ofdetail 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 ofdetail) is computed based on the accelerated scroll distance.

The value ofdetail 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

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp