We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

Window.ondeviceorientation

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

简介

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

语法

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

规范

Specification Status Comment
Device Orientation Events Working Draft Initial specification.

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

  
Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 7.0 [1] (Yes) 6 [2] ? ? ?
Constructor 59 ? ? ? ? ?
  
Feature Android Webview Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) [1] (Yes) [1] (Yes) 6 [2] No support No support 4.2
Constructor 59 59 ? ? ? ? ?

[1] Before version 50, Chrome provided absolute values instead of relative values for this event. Developers still needing absolute values may use the ondeviceorientationabsolute event.

[2] Firefox 3.6, 4, and 5 supported mozOrientation instead of the standard DeviceOrientationEvent interface

更多资料

文档标签和贡献者

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