blob: 743c8493cc2be748daf091743e2002e3d118eb92 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
---
title: Window.onuserproximity
slug: orphaned/Web/API/Window/onuserproximity
translation_of: Web/API/Window/onuserproximity
original_slug: Web/API/Window/onuserproximity
---
<p>{{ ApiRef() }}</p>
<p><strong><code>Window.onuserproxymity</code></strong> 属性代表一个 {{event("Event_handlers", "event handler")}}, 当触发 {{event("userproximity")}} 事件时会调用这个函数。这些事件是 {{domxref("UserProximityEvent")}} 类型的,在设备传感器检测到对象变得靠近时触发。</p>
<h2 id="语法">语法</h2>
<pre class="syntaxbox"><em>window</em>.onuserproximity = <em>eventHandler</em></pre>
<h2 id="说明">说明</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">说明</th>
<th scope="col">状态</th>
<th scope="col">评论</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ SpecName('Proximity Events', '#user-proximity', 'Proximity Events') }}</td>
<td>{{ Spec2('Proximity Events') }}</td>
<td>Initial specification</td>
</tr>
</tbody>
</table>
<h2 id="浏览器兼容">浏览器兼容</h2>
<p>{{Compat("api.Window.onuserproximity")}}</p>
<h2 id="其他">其他</h2>
<ul>
<li>{{event("userproximity")}}</li>
<li>{{domxref("UserProximityEvent")}}</li>
<li><a href="/en-US/docs/WebAPI/Proximity" title="/en-US/docs/WebAPI/Proximity">Proximity Events</a></li>
</ul>
|