DeviceMotionEvent: acceleration プロパティ

Baseline 2023
Newly available

Since September 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

acceleration プロパティは、端末によって記録された加速度の量をメートル毎秒毎秒 (m/s²)単位で返します。 DeviceMotionEvent.accelerationIncludingGravity とは異なり、加速度値は重力の影響を含みません。

メモ: ハードウェアが加速度データから重力を除去する方法を知らない場合、DeviceMotionEvent にこの値が存在しないことがあります。この場合、代わりに DeviceMotionEvent.accelerationIncludingGravity を使用する必要があります。

acceleration プロパティは 3 軸の加速度に関する情報を提供するオブジェクトです。それぞれの軸は自分自身でプロパティを使って表します。

x

西から東へ向かう軸である X 軸の加速度を表します。

y

南から北へ向かう軸である Y 軸の加速度を表します。

z

下から上へ向かう軸である Z 軸の加速度を表します。

仕様書

Specification
Device Orientation and Motion
# ref-for-dom-devicemotionevent-acceleration③

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
acceleration

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報