codecamp

window属性:ondeviceproximity

ondeviceproximity属性

ondeviceproximity属性指定一个事件侦听器来接收deviceproximity事件。当设备传感器检测到物体变得更接近或更远离设备时,会发生这些事件。

ondeviceproximity属性语法

window.onuserproximity = funcRef

deviceproximity事件发生时要调用的funcRef函数。这些事件是DeviceProximityEvent类型。

规范

规范状态注释
Proximity Sensor
该规范中“接近事件(Proximity Events)”的定义。
Working Draft
初始规范

浏览器兼容性

我们正在将兼容性数据转换为机器可读的JSON格式。

  • 电脑端
特征Chrome
Firefox(Gecko)Internet Explorer
Opera
Safari
基本支持不支持支持不支持不支持不支持 
  • 移动端

特征AndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
基本支持不支持不支持支持:15.0 不支持不支持不支持
window属性:ondeviceorientationabsolute
window属性:onerror
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定