From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../accelerationincludinggravity/index.html | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 files/zh-cn/web/api/devicemotionevent/accelerationincludinggravity/index.html (limited to 'files/zh-cn/web/api/devicemotionevent/accelerationincludinggravity') diff --git a/files/zh-cn/web/api/devicemotionevent/accelerationincludinggravity/index.html b/files/zh-cn/web/api/devicemotionevent/accelerationincludinggravity/index.html new file mode 100644 index 0000000000..b35c619384 --- /dev/null +++ b/files/zh-cn/web/api/devicemotionevent/accelerationincludinggravity/index.html @@ -0,0 +1,119 @@ +--- +title: DeviceMotionEvent.accelerationIncludingGravity +slug: Web/API/DeviceMotionEvent/accelerationIncludingGravity +tags: + - API + - Firefox OS + - 传感器 + - 运动传感器 + - 需要示例 +translation_of: Web/API/DeviceMotionEvent/accelerationIncludingGravity +--- +

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

+ +

accelerationIncludingGravity属性返回设备的加速度的记录,单位为米每秒平方(m / s2)与已移除重力加速度的{{domxref("DeviceMotionEvent.acceleration")}}不同,此值是由用户引起的设备的加速度和由重力加速度的总和。

+ +

此值通常不如{{domxref("DeviceMotionEvent.acceleration")}}实用,但是在部分不能自动从加速度数据中移除重力加速度的设备(例如没有陀螺仪的设备),是唯一可用值。

+ +

语法

+ +
var acceleration = instanceOfDeviceMotionEvent.accelerationIncludingGravity;
+
+ +

+ +

accelerationIncludingGravity是一个包括三轴(x、y、z)加速度信息的对象,每个轴都有自己的属性:

+ +
+
x
+
表示x轴(西到东)上的加速度
+
y
+
表示y轴(南到北)上的加速度
+
z
+
表示z轴(下到上)上的加速度
+
+ +

说明

+ + + + + + + + + + + + + + + + +
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