Window.ondeviceorientation

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

简介

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

语法

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

规范

Specification Status Comment
Device Orientation Events Working Draft Initial specification.

浏览器兼容性

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support71 Yes62 ? ? ?
DeviceOrientationEvent() constructor59 ? ? ? ? ?
absolute7 Yes6 ? ? ?
alpha7 Yes6 ? ? ?
beta7 Yes6 ? ? ?
gamma7 Yes6 ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes1 Yes1 Yes62 No4.2 ?
DeviceOrientationEvent() constructor5959 ? ? ? ? ?
absolute Yes Yes Yes6 No4.2 ?
alpha Yes Yes Yes6 No4.2 ?
beta Yes Yes Yes6 No4.2 ?
gamma Yes Yes Yes6 No4.2 ?

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,