aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/document/elementsfrompoint/index.html
blob: bea911988b2a9ea2968c0d5c2ecc244b2d0b32f0 (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
45
46
47
48
49
50
51
---
title: DocumentOrShadowRoot.elementsFromPoint()
slug: Web/API/Document/elementsFromPoint
translation_of: Web/API/DocumentOrShadowRoot/elementsFromPoint
original_slug: Web/API/DocumentOrShadowRoot/elementsFromPoint
---
<p>{{APIRef("Shadow DOM")}}{{SeeCompatTable}}</p>

<p><span class="seoSummary"><strong><code>elementsFromPoint()</code></strong>{{domxref("DocumentOrShadowRoot")}} 下的一个函数,该函数返还在特定坐标点下的HTML元素数组。</span></p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox">var elements = document.elementsFromPoint(x, y);</pre>

<h3 id="参数">参数</h3>

<dl>
 <dt>x</dt>
 <dd>坐标点的水平坐标值</dd>
 <dt>y</dt>
 <dd>坐标点的垂向坐标值</dd>
</dl>

<h3 id="返回值">返回值</h3>

<p>一个包含 {{domxref('element')}} 对象的数组.</p>

<h2 id="其他说明">其他说明</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('Shadow DOM','','elementsFromPoint()')}}</td>
   <td>{{Spec2('Shadow DOM')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>

<div>


<p>{{Compat("api.DocumentOrShadowRoot.elementsFromPoint")}}</p>
</div>