aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/mousescrollevent
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/api/mousescrollevent
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/api/mousescrollevent')
-rw-r--r--files/zh-cn/web/api/mousescrollevent/index.html159
1 files changed, 159 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/mousescrollevent/index.html b/files/zh-cn/web/api/mousescrollevent/index.html
new file mode 100644
index 0000000000..fc33ef0681
--- /dev/null
+++ b/files/zh-cn/web/api/mousescrollevent/index.html
@@ -0,0 +1,159 @@
+---
+title: MouseScrollEvent
+slug: Web/API/MouseScrollEvent
+translation_of: Web/API/MouseScrollEvent
+---
+<p>{{APIRef("DOM Events")}}{{ non-standard_header() }}{{deprecated_header}}</p>
+
+<p><code>MouseScrollEvent</code>事件对象代表了当用户在滚动鼠标滚轮或操作其他类似的输入设备时触发的事件.</p>
+
+<p>要优先使用标准化过的<a href="WheelEvent" title="https://developer.mozilla.org/zh-CN/docs/DOM/WheelEvent">WheelEvent</a>来代替该陈旧的事件对象.</p>
+
+<h2 id="方法概述">方法概述</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <td><code>void <a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDOMMouseScrollEvent#initMouseScrollEvent%28%29">initMouseScrollEvent</a>(in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMAbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in nsIDOMEventTarget relatedTargetArg, in long axis);</code></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="属性">属性</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <td class="header">名称</td>
+ <td class="header">
+ <p>类型</p>
+ </td>
+ <td class="header">描述</td>
+ </tr>
+ <tr>
+ <td><code>axis</code></td>
+ <td><code>long</code></td>
+ <td>表明鼠标滚轮滚动的方向. <strong>只读.</strong></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="常量">常量</h2>
+
+<h3 id="Delta_模式">Delta 模式</h3>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <td class="header">名称</td>
+ <td class="header">值</td>
+ <td class="header">描述</td>
+ </tr>
+ <tr>
+ <td><code>HORIZONTAL_AXIS</code></td>
+ <td><code>0x01</code></td>
+ <td>该事件是由鼠标滚轮的横向滚动触发的</td>
+ </tr>
+ <tr>
+ <td><code><code>VERTICAL_AXIS</code></code></td>
+ <td><code>0x02</code></td>
+ <td>该事件是由鼠标滚轮的纵向滚动触发的</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="方法">方法</h2>
+
+<h3 id="initMouseScrollEvent()">initMouseScrollEvent()</h3>
+
+<p>查看 <a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDOMMouseScrollEvent#initMouseScrollEvent%28%29" title="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIDOMMouseScrollEvent#initMouseScrollEvent%28%29">nsIDOMMouseScrollEvent::initMouseScrollEvent()</a>.</p>
+
+<h2 id="Browser_Compatibility" name="Browser_Compatibility">滚轮相关事件对比</h2>
+
+<table class="standard-table" style="height: 100px; width: 527px;">
+ <tbody>
+ <tr>
+ <td class="header">事件类型</td>
+ <td class="header">事件对象</td>
+ <td class="header">是否标准</td>
+ <td class="header">兼容性</td>
+ </tr>
+ <tr>
+ <td><a href="../../../zh-CN/docs/DOM/DOM_event_reference/mousewheel" title="https://developer.mozilla.org/zh-CN/docs/DOM/DOM_event_reference/mousewheel">mousewheel</a></td>
+ <td><a href="../../../zh-CN/docs/DOM/MouseWheelEvent" title="https://developer.mozilla.org/zh-CN/docs/DOM/MouseWheelEvent">MouseWheelEvent</a></td>
+ <td>非标准</td>
+ <td>只有Firefox不支持</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="../../../zh-CN/docs/DOM/DOM_event_reference/DOMMouseScroll" title="https://developer.mozilla.org/zh-CN/docs/DOM/DOM_event_reference/DOMMouseScroll">DOMMouseScroll</a></td>
+ <td><a class="new" href="../../../zh-CN/docs/DOM/MouseScrollEvent" title="https://developer.mozilla.org/zh-CN/docs/DOM/MouseScrollEvent">MouseScrollEvent</a></td>
+ <td>非标准</td>
+ <td>只有Firefox支持</td>
+ </tr>
+ <tr>
+ <td><a class="new" href="../../../zh-CN/docs/DOM/DOM_event_reference/wheel">wheel</a></td>
+ <td><a href="../../../zh-CN/docs/DOM/WheelEvent" title="https://developer.mozilla.org/zh-CN/docs/DOM/WheelEvent">WheelEvent</a></td>
+ <td><a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-wheel" title="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-wheel">DOM Level 3</a></td>
+ <td>Firefox 17+ ie9+</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari (WebKit)</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatGeckoDesktop("1.9.1") }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Phone</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatGeckoMobile("1.9.1") }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ <td>{{ CompatNo() }}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 class="note" id="相关链接">相关链接</h2>
+
+<ul>
+ <li><code>DOMMouseScroll</code></li>
+ <li><code>MozMousePixelScroll</code></li>
+ <li>非Gecko浏览器中的非标准的鼠标滚轮事件对象: {{ domxref("MouseWheelEvent") }}</li>
+ <li>被标准化的鼠标滚轮事件对象: {{ domxref("WheelEvent") }}</li>
+</ul>