DeviceProximityEvent

This article is in need of a technical review.

The DeviceProximityEvent provides information about the distance of a nearby physical object using the proximity sensor of a device.

Attributes

max
Read only. The maximum sensing distance the sensor is able to report, in centimeters.
min
Read only. The minimum sensing distance the sensor is able to report, in centimeters. Ususally zero.
value
Read only. The current device proximity, in centimeters.

Examples

window.addEventListener('deviceproximity', function(event) {
  console.log("Current = " + event.value +  " Max = " + event.max +  " Min = " + event.min);
});

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support Not supported Not supported Not supported Not supported Not supported
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support Not supported Not supported 15.0 (15.0) Not supported Not supported Not supported

Specifications

Specification Status Comment
Proximity Events Working Draft Initial specification

See also

Tags (3)

Contributors to this page: jswisher, Elchi3
Last updated by: jswisher,
Last reviewed by: jswisher,