aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/intersectionobserver/takerecords/index.html
blob: e0c7126117aa1c918bdf75aa9fe5dc76f95b9316 (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
52
53
54
55
56
57
58
---
title: IntersectionObserver.takeRecords()
slug: Web/API/IntersectionObserver/takeRecords
translation_of: Web/API/IntersectionObserver/takeRecords
---
<div>{{APIRef("Intersection Observer API")}}</div>

<p><span class="seoSummary">{{domxref("IntersectionObserver")}} 的方法<code><strong>takeRecords()</strong></code> 返回一个 {{domxref("IntersectionObserverEntry")}} 对象数组, </span>每个对象的目标元素都包含每次相交的信息<span class="seoSummary">, 可以</span>显式通过调用此方法或隐式地通过观察者的回调自动调用<span class="seoSummary">. </span></p>

<div class="note">
<p><strong>Note:</strong> 如果使用回调来监视这些更改,则无需调用此方法。调用此方法会清除挂起的相交状态列表,因此不会运行回调。</p>
</div>

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

<pre class="syntaxbox"><em>intersectionObserverEntries</em> = <em>intersectionObserver</em>.takeRecords();</pre>

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

<p>None.</p>

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

<p> {{domxref("IntersectionObserverEntry")}} 对象数组, 每个对象包含目标元素与根每次的相交信息。</p>

<dl>
</dl>

<h2 id="Examples">Examples</h2>

<p>&lt;&lt;&lt;...&gt;&gt;&gt;</p>

<h2 id="Specifications">Specifications</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('IntersectionObserver','#dom-intersectionobserver-takeRecords','IntersectionObserver.takeRecords()')}}</td>
   <td>{{Spec2('IntersectionObserver')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.IntersectionObserver.takeRecords")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/Intersection_Observer_API">Intersection Observer API</a></li>
</ul>