Window.ondeviceorientation - Web API 接口参考 编辑

简介

deviceorientation事件的事件处理程序,该事件包含了设备的相对旋转方向改变信息。

语法

window.ondeviceorientation = function(event) { ... };
window.addEventListener('deviceorientation', function(event) { ... });

规范

SpecificationStatusComment
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 7Notes
Full support 7Notes
Notes Before version 50, Chrome provided absolute values instead of relative values for this event. Developers still needing absolute values may use the ondeviceorientationabsolute event.
Edge Full support YesFirefox Full support 6Notes
Full support 6Notes
Notes Firefox 3.6, 4, and 5 supported mozOrientation instead of the standard DeviceOrientationEvent interface.
IE ?Opera ?Safari ?WebView Android Full support YesNotes
Full support YesNotes
Notes Before version 50, Chrome provided absolute values instead of relative values for this event. Developers still needing absolute values may use the ondeviceorientationabsolute event.
Chrome Android Full support YesNotes
Full support YesNotes
Notes Before version 50, Chrome provided absolute values instead of relative values for this event. Developers still needing absolute values may use the ondeviceorientationabsolute event.
Edge Mobile Full support YesFirefox Android Full support 6Notes
Full support 6Notes
Notes Firefox 3.6, 4, and 5 supported mozOrientation instead of the standard DeviceOrientationEvent interface.
Opera Android No support NoSafari iOS Full support 4.2Samsung Internet Android ?
DeviceOrientationEvent() 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 ?
absolute ExperimentalChrome Full support 7Edge 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 ?
alpha ExperimentalChrome Full support 7Edge 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 ?
beta ExperimentalChrome Full support 7Edge 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 ?
gamma ExperimentalChrome Full support 7Edge 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.
See implementation notes.
See implementation notes.
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技术交流群

发布评论

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

词条统计

浏览:90 次

字数:23766

最后编辑:6年前

编辑次数:0 次

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