From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/deviceorientationevent/absolute/index.html | 100 +++++++++++++++++ .../api/deviceorientationevent/alpha/index.html | 53 +++++++++ .../web/api/deviceorientationevent/beta/index.html | 97 +++++++++++++++++ .../api/deviceorientationevent/gamma/index.html | 98 +++++++++++++++++ .../web/api/deviceorientationevent/index.html | 119 +++++++++++++++++++++ 5 files changed, 467 insertions(+) create mode 100644 files/zh-cn/web/api/deviceorientationevent/absolute/index.html create mode 100644 files/zh-cn/web/api/deviceorientationevent/alpha/index.html create mode 100644 files/zh-cn/web/api/deviceorientationevent/beta/index.html create mode 100644 files/zh-cn/web/api/deviceorientationevent/gamma/index.html create mode 100644 files/zh-cn/web/api/deviceorientationevent/index.html (limited to 'files/zh-cn/web/api/deviceorientationevent') diff --git a/files/zh-cn/web/api/deviceorientationevent/absolute/index.html b/files/zh-cn/web/api/deviceorientationevent/absolute/index.html new file mode 100644 index 0000000000..2ac880891c --- /dev/null +++ b/files/zh-cn/web/api/deviceorientationevent/absolute/index.html @@ -0,0 +1,100 @@ +--- +title: DeviceOrientationEvent.absolute +slug: Web/API/DeviceOrientationEvent/absolute +translation_of: Web/API/DeviceOrientationEvent/absolute +--- +

{{ apiref("Device Orientation Events") }}

+ +

表示该设备是否提供绝对定位数据 (这个数据是关于地球的坐标系) 或者使用了由设备决定的专门的坐标系. 查看更多关于 Orientation and motion data explained 的细节.

+ +

语法

+ +
var absolute = instanceOfDeviceOrientationEvent.absolute;
+
+ +

如果方向数据跟地球坐标系和设备坐标系有差异,则absolutetrue,如果方向数据由设备本身的坐标系提供,则absolutefalse

+ +

说明

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Device Orientation')}}{{Spec2('Device Orientation')}}Initial specification.
+ +

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support7.0{{CompatVersionUnknown}}6 [1]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support3.0{{CompatVersionUnknown}}6 [1]{{CompatNo}}{{CompatNo}}4.2
+
+ +

[1] Firefox 3.6, 4, and 5 supported mozOrientation instead of the standard DeviceOrientationEvent interface

+ +

参见

+ + diff --git a/files/zh-cn/web/api/deviceorientationevent/alpha/index.html b/files/zh-cn/web/api/deviceorientationevent/alpha/index.html new file mode 100644 index 0000000000..e4a6a0a4d4 --- /dev/null +++ b/files/zh-cn/web/api/deviceorientationevent/alpha/index.html @@ -0,0 +1,53 @@ +--- +title: DeviceOrientationEvent.alpha +slug: Web/API/DeviceOrientationEvent/alpha +tags: + - API + - 陀螺仪 +translation_of: Web/API/DeviceOrientationEvent/alpha +--- +

{{ ApiRef("Device Orientation Events") }}

+ +

返回设备旋转时Z轴的值;即:设备围绕屏幕中心扭转的角度。  详细信息请查看方向和运动数据

+ +

Syntax

+ +
var alpha = instanceOfDeviceOrientationEvent.alpha;
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Device Orientation')}}{{Spec2('Device Orientation')}}Initial specification.
+ +

Browser compatibility

+ +

 

+ +

{{Compat("api.DeviceOrientationEvent.alpha")}}

+ +

 

+ +

See also

+ + diff --git a/files/zh-cn/web/api/deviceorientationevent/beta/index.html b/files/zh-cn/web/api/deviceorientationevent/beta/index.html new file mode 100644 index 0000000000..9cec365dce --- /dev/null +++ b/files/zh-cn/web/api/deviceorientationevent/beta/index.html @@ -0,0 +1,97 @@ +--- +title: DeviceOrientationEvent.beta +slug: Web/API/DeviceOrientationEvent/beta +translation_of: Web/API/DeviceOrientationEvent/beta +--- +

{{ ApiRef("Device Orientation Events") }}

+ +

返回设备旋转时X轴的值. 即: 角度的数值, 范围介于-180 ------ 180之间  表示设备正在向前或向后倾斜.更多信息见  方向和运动数据详解

+ +

语法

+ +
var beta = instanceOfDeviceOrientationEvent.beta;
+ +

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Device Orientation')}}{{Spec2('Device Orientation')}}Initial specification.
+ +

浏览器的兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support7.0{{CompatVersionUnknown}}6 [1]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support3.0{{CompatVersionUnknown}}6 [1]{{CompatNo}}{{CompatNo}}4.2
+
+ +

[1] Firefox 3.6, 4, and 5 supported mozOrientation instead of the standard DeviceOrientationEvent interface

+ +

另请参阅

+ + diff --git a/files/zh-cn/web/api/deviceorientationevent/gamma/index.html b/files/zh-cn/web/api/deviceorientationevent/gamma/index.html new file mode 100644 index 0000000000..6bff9aef20 --- /dev/null +++ b/files/zh-cn/web/api/deviceorientationevent/gamma/index.html @@ -0,0 +1,98 @@ +--- +title: DeviceOrientationEvent.gamma +slug: Web/API/DeviceOrientationEvent/gamma +translation_of: Web/API/DeviceOrientationEvent/gamma +--- +

{{ apiref("Device Orientation Events") }}

+ +

返回设备旋转时Y轴的值;即,多少度,介于之间-9090,通过该装置被接通向左或向右。方向和运动数据解释的细节。

+ +

Syntax

+ +
var gamma = orientationEvent.gamma;
+
+ +

Specifications

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
设备方向事件{Spec2('Device Orientation')}}Initial specification.
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support7.0{{CompatVersionUnknown}}6 [1]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support3.0{{CompatVersionUnknown}}6 [1]{{CompatNo}}{{CompatNo}}4.2
+
+ +

[1]火狐3.6,图4和5支撑mozOrientation而不是标准DeviceOrientationEvent接口

+ +

See also

+ + diff --git a/files/zh-cn/web/api/deviceorientationevent/index.html b/files/zh-cn/web/api/deviceorientationevent/index.html new file mode 100644 index 0000000000..a65efefa94 --- /dev/null +++ b/files/zh-cn/web/api/deviceorientationevent/index.html @@ -0,0 +1,119 @@ +--- +title: DeviceOrientationEvent +slug: Web/API/DeviceOrientationEvent +translation_of: Web/API/DeviceOrientationEvent +--- +

{{apiref("Device Orientation Events")}}{{SeeCompatTable}}

+ +

DeviceOrientationEvent提供给网页开发者当设备(指手机,平板等移动设备)在浏览页面时物理旋转的信息。

+ +
+

警告: 当前,火狐浏览器和谷歌浏览器并未能用同一种方式实现,在使用请注意。(见后文) 

+
+ +

属性

+ +
+
{{domxref("DeviceOrientationEvent.absolute")}} {{readonlyinline}}
+
用来说明设备是提供的旋转数据是否是绝对定位的布尔值。
+
{{domxref("DeviceOrientationEvent.alpha")}} {{readonlyinline}}
+
一个表示设备绕z轴旋转的角度(范围在0-360之间)的数字
+
 
+
{{domxref("DeviceOrientationEvent.beta")}} {{readonlyinline}}
+
一个表示设备绕x轴旋转(范围在-180到180之间)的数字,从前到后的方向为正方向。
+
{{domxref("DeviceOrientationEvent.gamma")}} {{readonlyinline}}
+
一个表示设备绕y轴旋转(范围在-90到90之间)的数字,从左向右为正方向。
+
+ +

例子

+ +
window.addEventListener('deviceorientation', function(event) {
+  console.log(event.alpha + ' : ' + event.beta + ' : ' + event.gamma);
+});
+ +

规范

+ + + + + + + + + + + + + + + + +
规范状态草案
{{SpecName('Device Orientation')}}{{Spec2('Device Orientation')}}Initial specification.
+ +

浏览器支持

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support7.0 [1]6 [2]{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidAndroid WebviewFirefox Mobile (Gecko)IE MobileOpera MobileSafari MobileChrome for Android
Basic support3.0{{CompatVersionUnknown}} [1]6 [2]{{CompatNo}}{{CompatNo}}4.2{{CompatVersionUnknown}} [1]
+
+ +

[1] 在版本50之前Chrome为该事件提供绝对的值而非相对的值。开发者仍需使用绝对的值,当使用{{domxref("ondeviceorientationabsolute")}} 事件时.

+ +

[2] 火狐3.6, 4, and 5支持mozOrientation 而非标准的 DeviceOrientationEvent

+ +

参考

+ + -- cgit v1.2.3-54-g00ecf