DeviceMotionEvent.DeviceMotionEvent()

非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!

The DeviceMotionEvent constructor 会创建一个新的 DeviceMotionEvent.

语法

var deviceMotionEvent = new DeviceMotionEvent(type[, options])

参数

type

必须是 "devicemotion".

options可选

可选项如下:

  • acceleration: 一个对象,包含设备在 X,Y 和 Z 三个轴线上的加速度。加速度的单位为m/s2.
  • accelerationIncludingGravity: 一个对象,包含设备在 X,Y 和 Z 三个轴线上,重力作用下的加速度。加速度的单位为m/s2.
  • rotationRate: 一个对象,包含设备的定向在三个定向轴 alpha, beta 和 gamma 上的偏移比率。偏移比率的单位是每秒偏移的角度。
  • interval: 时间间隔,单位毫秒,表示设备获取数据的间隔时间。

说明

无特别说明。

浏览器兼容性

BCD tables only load in the browser