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/devicemotionevent/rotationrate/index.html | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 files/zh-cn/web/api/devicemotionevent/rotationrate/index.html (limited to 'files/zh-cn/web/api/devicemotionevent/rotationrate') diff --git a/files/zh-cn/web/api/devicemotionevent/rotationrate/index.html b/files/zh-cn/web/api/devicemotionevent/rotationrate/index.html new file mode 100644 index 0000000000..513d403ec0 --- /dev/null +++ b/files/zh-cn/web/api/devicemotionevent/rotationrate/index.html @@ -0,0 +1,120 @@ +--- +title: DeviceMotionEvent.rotationRate +slug: Web/API/DeviceMotionEvent/rotationRate +tags: + - API + - DOM + - Firefox OS + - 传感器 + - 运动传感器 + - 需要示例 +translation_of: Web/API/DeviceMotionEvent/rotationRate +--- +

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

+ +

返回设备围绕其每个轴(x、y、z)旋转的速率(单位:度/秒)。

+ +
注意: 如果设备无法提供此信息,则为null
+ +

语法

+ +
var rates = instanceOfDeviceMotionEvent.rotationRate;
+
+ +

+ +

rotationRates属性是一个只读对象,用于描述设备围绕其每个轴的旋转速率:

+ +
+
alpha
+
设备绕其Z轴旋转的速率(即绕垂直于屏幕的线旋转)
+
beta
+
设备绕其X轴旋转的速率(即从前到后旋转)
+
gamma
+
设备绕其Y轴旋转的速率(即从一侧到另一侧)
+
+ +

说明

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

浏览器兼容性

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("6")}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatGeckoMobile("6")}}{{CompatNo}}{{CompatNo}}4.2
+
+ +

推荐阅读

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