Window.ondevicemotion - Web API 接口参考 编辑
摘要
一个发送到窗口的devicemotion
事件处理程序。
语法
window.ondevicemotion = funcRef;
Where funcRef
is a reference to a function. This function receives a DeviceMotionEvent
object describing the motion that occurred.
这里的funcRef
是一个函数的引用。这个函数接收一个DeviceMotionEvent
对象类型的参数描述发生的动作。
规范
规范 | 状态 | 备注 |
---|---|---|
DeviceOrientation Event Specification | Editor's Draft | Initial specification. |
浏览器兼容
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. Update compatibility data on GitHubDesktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | |
Basic support Experimental | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 6 | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 6 | Opera Android No support No | Safari iOS Full support 4.2 | Samsung Internet Android ? |
DeviceMotionEvent() constructor ExperimentalNon-standard | Chrome Full support 59 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 59 | Chrome Android Full support 59 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
acceleration Experimental | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 6 | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 6 | Opera Android No support No | Safari iOS Full support 4.2 | Samsung Internet Android ? |
accelerationIncludingGravity Experimental | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 6 | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 6 | Opera Android No support No | Safari iOS Full support 4.2 | Samsung Internet Android ? |
interval Experimental | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 6 | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 6 | Opera Android No support No | Safari iOS Full support 4.2 | Samsung Internet Android ? |
rotationRate Experimental | Chrome Full support Yes | Edge Full support Yes | Firefox Full support 6 | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Edge Mobile Full support Yes | Firefox Android Full support 6 | Opera Android No support No | Safari iOS Full support 4.2 | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
参考
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论