From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../zh-cn/web/api/deviceproximityevent/index.html | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 files/zh-cn/web/api/deviceproximityevent/index.html (limited to 'files/zh-cn/web/api/deviceproximityevent') diff --git a/files/zh-cn/web/api/deviceproximityevent/index.html b/files/zh-cn/web/api/deviceproximityevent/index.html new file mode 100644 index 0000000000..9e41e775dc --- /dev/null +++ b/files/zh-cn/web/api/deviceproximityevent/index.html @@ -0,0 +1,104 @@ +--- +title: DeviceProximityEvent +slug: Web/API/DeviceProximityEvent +translation_of: Web/API/DeviceProximityEvent +--- +

{{APIRef("Proximity Events")}}{{SeeCompatTable}}

+ +

 DeviceProximityEvent 接口利用设备的近距离感应器提供有关邻近物品的距离信息。

+ +

属性

+ +
+
{{domxref("DeviceProximityEvent.max")}} {{readonlyinline}}
+
最大可反馈的感应距离,以厘米记。
+
{{domxref("DeviceProximityEvent.min")}} {{readonlyinline}}
+
最小可反馈的感应距离,以厘米记,通常是零。
+
{{domxref("DeviceProximityEvent.value")}} {{readonlyinline}}
+
当前设备接近距离,以厘米记。
+
+ +

示例

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

规范

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{ SpecName('Proximity Events', '', 'Proximity Events') }}{{ Spec2('Proximity Events') }}Initial specification
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatNo() }}{{ CompatVersionUnknown() }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatNo() }}{{ CompatNo() }}{{ CompatGeckoMobile("15.0") }}{{ CompatNo() }}{{ CompatNo() }}{{ CompatNo() }}
+
+ +

参见

+ + -- cgit v1.2.3-54-g00ecf