-
Notifications
You must be signed in to change notification settings - Fork 8.3k
[zh-cn]: create the translation of Element MozMousePixelScroll event
#37864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
yin1999
merged 2 commits into
mdn:main
from
T34-active:element_MozMousePixelScroll_20260819
Sep 1, 2026
+52
−0
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
files/zh-cn/web/api/element/mozmousepixelscroll_event/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
| title: Element:MozMousePixelScroll 事件 | ||
| short-title: MozMousePixelScroll | ||
| slug: Web/API/Element/MozMousePixelScroll_event | ||
| l10n: | ||
| sourceCommit: a7265fc3effa7c25b9997135104370c057a65293 | ||
| --- | ||
|
|
||
| {{APIRef("UI Events")}}{{deprecated_header}}{{Non-standard_header}} | ||
|
T34-active marked this conversation as resolved.
Outdated
|
||
|
|
||
| **`MozMousePixelScroll`** 事件是仅 Firefox 支持的、*非标准*且*已废弃*的事件,会在操作鼠标滚轮或类似设备时于 {{domxref("Element")}} 上异步触发。它由 {{domxref("MouseScrollEvent")}} 接口表示。 | ||
|
T34-active marked this conversation as resolved.
Outdated
|
||
|
|
||
| > [!NOTE] | ||
| > 请勿使用该非标准且已废弃的事件。应始终使用标准 {{domxref("Element.wheel_event", "wheel")}} 事件。 | ||
|
T34-active marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## 语法 | ||
|
|
||
| 在 {{domxref("EventTarget.addEventListener", "addEventListener()")}} 等方法中使用事件名称,或设置事件处理器属性。 | ||
|
|
||
| ```js-nolint | ||
| addEventListener("MozMousePixelScroll", (event) => { }) | ||
|
|
||
| onMozMousePixelScroll = (event) => { } | ||
| ``` | ||
|
|
||
| ## 事件类型 | ||
|
|
||
| {{domxref("WheelEvent")}},继承自 {{domxref("MouseEvent")}}、{{domxref("UIEvent")}} 和 {{domxref("Event")}}。 | ||
|
T34-active marked this conversation as resolved.
Outdated
|
||
|
|
||
| {{InheritanceDiagram("WheelEvent")}} | ||
|
|
||
| ## 获取滚动距离 | ||
|
|
||
| 事件的 {{domxref("UIEvent/detail", "detail")}} 属性以行为单位表示滚动距离:负值表示向下或向右滚动,正值表示向上或向左滚动。 | ||
|
|
||
| 如果平台原生鼠标滚轮事件以行或页为单位表示滚动距离,则 `detail` 的值由该值及包含目标元素的最近可滚动祖先元素的行高或页面宽高计算。 | ||
|
|
||
| > [!NOTE] | ||
| > 在 macOS 上,滚动距离(因此也包括 `detail` 的值)根据加速后的滚动距离计算。 | ||
|
|
||
| 事件合法时,`detail` 的值绝不会为 0。 | ||
|
|
||
| ## 浏览器兼容性 | ||
|
|
||
| {{Compat}} | ||
|
|
||
| ## 参见 | ||
|
|
||
| - {{domxref("MouseScrollEvent")}} | ||
| - Gecko 的旧式按行或页滚动事件:`DOMMouseScroll` | ||
| - 非 Gecko 浏览器的旧式鼠标滚轮事件:`mousewheel` | ||
| - 标准化滚轮事件:`wheel` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.