aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html')
-rw-r--r--files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html b/files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html
new file mode 100644
index 0000000000..fcbe9a2864
--- /dev/null
+++ b/files/zh-cn/web/api/devicemotionevent/devicemotionevent/index.html
@@ -0,0 +1,38 @@
+---
+title: DeviceMotionEvent.DeviceMotionEvent()
+slug: Web/API/DeviceMotionEvent/DeviceMotionEvent
+translation_of: Web/API/DeviceMotionEvent/DeviceMotionEvent
+---
+<p>{{APIRef("Device Orientation Events")}}{{Non-standard_header}}</p>
+
+<p>The <strong><code>DeviceMotionEvent</code></strong> constructor 会创建一个新的 {{DOMxRef("DeviceMotionEvent")}}.</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="syntaxbox">var deviceMotionEvent = new DeviceMotionEvent(type[, options])</pre>
+
+<h3 id="参数">参数</h3>
+
+<dl>
+ <dt><code>type</code></dt>
+ <dd>必须是 <code>"devicemotion"</code>.</dd>
+ <dt><code>options</code>{{Optional_Inline}}</dt>
+ <dd>可选项如下:
+ <ul>
+ <li><code>acceleration</code>: 一个对象,包含设备在X,Y和Z三个轴线上的加速度。加速度的单位为<a href="https://en.wikipedia.org/wiki/Meter_per_second_squared" title="https://en.wikipedia.org/wiki/Meter_per_second_squared">m/s<sup>2</sup></a>.</li>
+ <li><code>accelerationIncludingGravity</code>: 一个对象,包含设备在X,Y和Z三个轴线上,重力作用下的加速度。加速度的单位为<a href="https://en.wikipedia.org/wiki/Meter_per_second_squared" title="https://en.wikipedia.org/wiki/Meter_per_second_squared">m/s<sup>2</sup></a>.</li>
+ <li><code>rotationRate</code>: 一个对象,包含设备的定向在三个定向轴alpha, beta 和 gamma上的偏移比率。偏移比率的单位是每秒偏移的角度。</li>
+ <li><code>interval</code>: 时间间隔,单位毫秒,表示设备获取数据的间隔时间。</li>
+ </ul>
+ </dd>
+</dl>
+
+<h2 id="说明">说明</h2>
+
+<p>无特别说明。</p>
+
+<h2 id="浏览器兼容">浏览器兼容</h2>
+
+
+
+<p>{{Compat("api.DeviceMotionEvent.DeviceMotionEvent")}}</p>