codecamp

window属性:ondevicemotion

ondevicemotion属性

发送到window的devicemotion事件的事件处理程序。

ondevicemotion属性语法

window.ondevicemotion = funcRef;

funcRef是一个函数的引用。该功能接收DeviceMotionEvent对象来描述发生的动作。

规范

规范状态注释
Device Orientation Events
Working Draft
初始规格

浏览器兼容性 

  • 电脑端
特征Chrome
Edge
Firefox(Gecko)
Internet Explorer
Opera
Safari(WebKit)
基本支持支持支持支持:6
构造函数支持:59
  • 移动端
特征Android WebviewChrome for AndroidEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
基本支持支持支持支持支持:6.0不支持不支持支持:4.2
构造函数支持:59支持:59?????
window属性:ondevicelight
window属性:ondeviceorientation
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定