DeviceMotionEventAcceleration

可用性有限

此特性不是基线特性,因为它在一些最广泛使用的浏览器中不起作用。

安全上下文: 此功能仅在安全上下文(HTTPS)中可用,且支持此功能的浏览器数量有限。

DeviceMotionEventAcceleration 接口属于 Device Orientation Events,它提供了有关设备沿所有三个轴的加速度信息。

实例属性

DeviceMotionEventAcceleration.x 只读

沿 X 轴的加速度大小。

DeviceMotionEventAcceleration.y 只读

沿 Y 轴的加速度大小。

DeviceMotionEventAcceleration.z 只读

沿 Z 轴的加速度大小。

规范

规范
设备方向和运动
# devicemotioneventacceleration

浏览器兼容性