blob: 7c74434f69b8e8892b495b7158c75fee74fb325f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
---
title: Window.ondeviceorientation
slug: conflicting/Web/API/Window/deviceorientation_event
translation_of: Web/API/Window/ondeviceorientation
original_slug: Web/API/Window/ondeviceorientation
---
<p>{{ ApiRef() }}</p>
<h2 id="Summary" name="Summary">简介</h2>
<p>{{ event("deviceorientation") }}事件的事件处理程序,该事件包含了设备的相对旋转方向改变信息。</p>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox">window.ondeviceorientation = function(event) { ... };
window.addEventListener('deviceorientation', function(event) { ... });
</pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</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/DeviceOrientationEvent","Browser_compatibility") }}</p>
<h2 id="更多资料">更多资料</h2>
<ul>
<li>{{ event("deviceorientation") }}</li>
<li>{{ domxref("DeviceOrientationEvent") }}</li>
<li><a href="/en/Detecting_device_orientation" title="Detecting device orientation">Detecting device orientation</a></li>
</ul>
|