非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
DeviceOrientationEvent
构造函数创建新
DeviceOrientationEvent
.
var deviceOrientationEvent = new DeviceOrientationEvent(type[, options])
type
"deviceorientation"
or
"deviceorientationabsolute"
. If the later, then
options.absolute
should be true.
beta
: A number representing the motion of the device around the x axis, express in degrees with values ranging from -180 to 180. This represents a front to back motion of the device.
gamma
: A number representing the motion of the device around the y axis, express in degrees with values ranging from -90 to 90. This represents a left to right motion of the device.
absolute
: A boolean that indicates whether or not the device is providing orientation data absolutely.
| 规范 | 状态 | 注释 |
|---|---|---|
| DeviceOrientation Event Specification | 编者草案 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
DeviceOrientationEvent()
构造函数
非标
|
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 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
DeviceOrientationEvent
DeviceOrientationEvent()