DeviceMotionEvent.acceleration
Baseline
2023
Newly available
Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
acceleration 属性会返回设备的加速度记录(单位:m / s2)。
备注:
如果硬件无法从 acceleration 数据中移除重力加速度,则该值在DeviceMotionEvent
中可能并不存在,你应当使用DeviceMotionEvent.accelerationIncludingGravity
代替
值
acceleration
是一个包括三轴(x、y、z)加速度信息的对象,每个轴都有自己的属性:
说明
Specification |
---|
Device Orientation and Motion> # dom-devicemotionevent-acceleration> |
浏览器兼容性
Loading…