DeviceMotionEvent.accelerationIncludingGravity
Baseline 2023Newly available
Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
accelerationIncludingGravity 属性返回设备的加速度的记录,单位为米每秒平方(m / s2)。与已移除重力加速度的DeviceMotionEvent.acceleration
不同,此值是由用户引起的设备的加速度和由重力加速度的总和。
此值通常不如DeviceMotionEvent.acceleration
实用,但是在部分不能自动从加速度数据中移除重力加速度的设备(例如没有陀螺仪的设备),是唯一可用值。
语法
var acceleration = instanceOfDeviceMotionEvent.accelerationIncludingGravity;
值
说明
Specification |
---|
Device Orientation and Motion # ref-for-dom-devicemotionevent-accelerationincludinggravity④ |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
accelerationIncludingGravity |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.