window属性:ondeviceorientation

2018-04-28 11:33 更新

ondeviceorientation属性

ondeviceorientation属性表示deviceorientation事件的事件处理程序,其中包含有关相对设备方向更改的信息。

ondeviceorientation属性语法

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

规范

规范状态注释
Device Orientation Events(设备方向事件)
Working Draft
初始规格

浏览器兼容性

  • 电脑端
特征Chrome
Edge
Firefox(Gecko)
Internet ExplorerOpera
Safari(WebKit)
基本支持支持:7.0 [1]支持支持:6 [2]
构造函数支持:59
  • 移动端
特征Android WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持支持 [1]支持 [1]支持支持:6 [2]不支持不支持支持:4.2
构造函数支持:59支持:59?????

注释:

[1]在版本50之前,Chrome为此事件提供绝对值而不是相对值。仍然需要绝对值的开发人员可以使用该ondeviceorientationabsolute事件。

[2] Firefox 3.6,4和5支持mozOrientation而不是标准DeviceOrientationEvent接口

以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号