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 SpecificationEditor's DraftInitial 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 GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support ExperimentalChrome Full support YesEdge Full support YesFirefox Full support 6IE ?Opera ?Safari ?WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 6Opera Android No support NoSafari iOS Full support 4.2Samsung Internet Android ?
DeviceMotionEvent() constructor ExperimentalNon-standardChrome Full support 59Edge ?Firefox ?IE ?Opera ?Safari ?WebView Android Full support 59Chrome Android Full support 59Edge Mobile ?Firefox Android ?Opera Android ?Safari iOS ?Samsung Internet Android ?
acceleration ExperimentalChrome Full support YesEdge Full support YesFirefox Full support 6IE ?Opera ?Safari ?WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 6Opera Android No support NoSafari iOS Full support 4.2Samsung Internet Android ?
accelerationIncludingGravity ExperimentalChrome Full support YesEdge Full support YesFirefox Full support 6IE ?Opera ?Safari ?WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 6Opera Android No support NoSafari iOS Full support 4.2Samsung Internet Android ?
interval ExperimentalChrome Full support YesEdge Full support YesFirefox Full support 6IE ?Opera ?Safari ?WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 6Opera Android No support NoSafari iOS Full support 4.2Samsung Internet Android ?
rotationRate ExperimentalChrome Full support YesEdge Full support YesFirefox Full support 6IE ?Opera ?Safari ?WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 6Opera Android No support NoSafari iOS Full support 4.2Samsung 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.
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.

参考

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:93 次

字数:20544

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文