非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
DeviceMotionEvent
构造函数创建新
DeviceMotionEvent
.
var deviceMotionEvent = new DeviceMotionEvent(type[, options])
type
"devicemotion"
.
选项
可选
acceleration
: An object giving the acceleration of the device on the three axis X, Y and Z. Acceleration is expressed in
m/s
2
.
accelerationIncludingGravity
: An object giving the acceleration of the device on the three axis X, Y and Z with the effect of gravity. Acceleration is expressed in
m/s
2
.
rotationRate
: An object giving the rate of change of the device's orientation on the three orientation axis alpha, beta and gamma. Rotation rate is express in degrees per seconds.
interval
: A number representing the interval of time, in milliseconds, at which data is obtained from the device.
Not part of any specifications.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
DeviceMotionEvent()
构造函数
非标
|
Chrome 59 | Edge ≤79 | Firefox ? | IE No | Opera ? | Safari ? | WebView Android 59 | Chrome Android 59 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 7.0 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
DeviceMotionEvent
DeviceMotionEvent()