Window.ondevicemotion

这篇翻译不完整。请帮忙从英语翻译这篇文章

摘要

一个发送到窗口的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 对象类型的参数描述发生的动作。

规范

规范 状态 备注
Device Orientation Events Working Draft Initial specification.

浏览器兼容

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome 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-standard
Chrome 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
Experimental
Chrome 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
Experimental
Chrome 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
Experimental
Chrome 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
Experimental
Chrome 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.

参考

文档标签和贡献者

此页面的贡献者: pinpinye, Mmzer
最后编辑者: pinpinye,