This read-only property indicates the amount of acceleration that occurred along the X axis in a
DeviceMotionEventAcceleration
对象。
var xAccel = DeviceMotionEventAcceleration.x;
x
double
indicating the amount of acceleration along the X axis. See
Accelerometer values explained
了解细节。
| 规范 | 状态 | 注释 |
|---|---|---|
|
DeviceOrientation Event Specification
The definition of 'DeviceMotionEventAcceleration: x' in that specification. |
编者草案 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
x
|
Chrome No | Edge 12 — 79 | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android ≤37 | Chrome Android 28 | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android 1.5 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
DeviceMotionEventAcceleration
DeviceMotionEventAcceleration: x
DeviceMotionEventAcceleration: y
DeviceMotionEventAcceleration: z