aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/window/ondevicemotion
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/window/ondevicemotion
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/window/ondevicemotion')
-rw-r--r--files/zh-cn/web/api/window/ondevicemotion/index.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/window/ondevicemotion/index.html b/files/zh-cn/web/api/window/ondevicemotion/index.html
new file mode 100644
index 0000000000..41cda848df
--- /dev/null
+++ b/files/zh-cn/web/api/window/ondevicemotion/index.html
@@ -0,0 +1,57 @@
+---
+title: Window.ondevicemotion
+slug: Web/API/Window/ondevicemotion
+tags:
+ - API
+ - Device Orientation
+ - Firefox OS
+ - Mobile
+ - Motion
+ - 移动端设备
+translation_of: Web/API/Window/ondevicemotion
+---
+<p>{{ ApiRef() }}</p>
+
+<h2 id="Summary" name="Summary">摘要</h2>
+
+<p>一个发送到窗口的{{ event("devicemotion")}}事件处理程序。</p>
+
+<h2 id="Syntax" name="Syntax">语法</h2>
+
+<pre>window.ondevicemotion = funcRef;
+</pre>
+
+<p>Where <code>funcRef</code> is a reference to a function. This function receives a {{ domxref("DeviceMotionEvent") }} object describing the motion that occurred.</p>
+
+<p>这里的<code>funcRef</code>是一个函数的引用。这个函数接收一个{{ domxref("DeviceMotionEvent") }} 对象类型的参数描述发生的动作。</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">规范</th>
+ <th scope="col">状态</th>
+ <th scope="col">备注</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Device Orientation')}}</td>
+ <td>{{Spec2('Device Orientation')}}</td>
+ <td>Initial specification.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+<p>{{ page("/en-US/docs/Web/API/DeviceMotionEvent","Browser_compatibility") }}</p>
+
+<h2 id="参考">参考</h2>
+
+<ul>
+ <li>{{ event("devicemotion") }}</li>
+ <li>{{ domxref("DeviceMotionEvent") }}</li>
+ <li><a href="/en/Detecting_device_orientation" title="Detecting device orientation">Detecting device orientation</a></li>
+</ul>