过时
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
max
property provides the maximum sensing distance the sensor is able to report, in centimeters.
var value = instanceOfDeviceProximityEvent.max;
A positive number indicating the maximum distance, in centimeters (cm), that the device's proximity sensor is able to detect and report.
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
max
非标
|
Chrome No | Edge No |
Firefox
62
Disabled
|
IE No | Opera No | Safari No | WebView Android No | Chrome Android No |
Firefox Android
62
Disabled
|
Opera Android No | Safari iOS No | Samsung Internet Android No |
完整支持
不支持
实验。期望将来行为有所改变。
非标。预期跨浏览器支持较差。
见实现注意事项。
用户必须明确启用此特征。
DeviceProximityEvent