DeviceMotionEvent.acceleration
acceleration 属性会返回设备的加速度记录(单位:m / s2)。
备注: 如果硬件无法从 acceleration 数据中移除重力加速度,则该值在DeviceMotionEvent
中可能并不存在,你应当使用DeviceMotionEvent.accelerationIncludingGravity
代替
语法
var acceleration = instanceOfDeviceMotionEvent.acceleration;
值
说明
Specification |
---|
DeviceOrientation Event Specification # ref-for-dom-devicemotionevent-acceleration③ |
浏览器兼容性
BCD tables only load in the browser