W3cubDocs

/Web APIs

Window.ondevicemotion

An event handler for the devicemotion events sent to the window.

Syntax

window.ondevicemotion = funcRef;

Where funcRef is a reference to a function. This function receives a DeviceMotionEvent object describing the motion that occurred.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ondevicemotion
31
12
9
11
18
No
4.4
31
9
18
4.2
2.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Window/ondevicemotion