diff options
Diffstat (limited to 'files/zh-cn/web/api/intersectionobserver/index.html')
-rw-r--r-- | files/zh-cn/web/api/intersectionobserver/index.html | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/files/zh-cn/web/api/intersectionobserver/index.html b/files/zh-cn/web/api/intersectionobserver/index.html index e3bcf96bd3..1aa608a771 100644 --- a/files/zh-cn/web/api/intersectionobserver/index.html +++ b/files/zh-cn/web/api/intersectionobserver/index.html @@ -47,11 +47,12 @@ translation_of: Web/API/IntersectionObserver <dt>{{domxref("IntersectionObserver.unobserve()")}}</dt> <dd><font face="Open Sans, arial, x-locale-body, sans-serif">使</font><code>IntersectionObserver</code>停止监听特定目标元素。</dd> <dt> - <h2 id="示例">示例</h2> </dt> </dl> -<pre><code>var intersectionObserver = new IntersectionObserver(function(entries) { +<h2 id="示例">示例</h2> + +<pre class="brush: js">var intersectionObserver = new IntersectionObserver(function(entries) { // If intersectionRatio is 0, the target is out of view // and we do not need to do anything. if (entries[0].intersectionRatio <= 0) return; @@ -60,28 +61,15 @@ translation_of: Web/API/IntersectionObserver console.log('Loaded new items'); }); // start observing -intersectionObserver.observe(document.querySelector('.scrollerFooter'));</code></pre> +intersectionObserver.observe(document.querySelector('.scrollerFooter'));</pre> <h2 id="规范">规范</h2> -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">规范</th> - <th scope="col">状态</th> - <th scope="col">备注</th> - </tr> - <tr> - <td>{{SpecName("IntersectionObserver", "#intersection-observer-interface", "IntersectionObserver")}}</td> - <td>{{Spec2('IntersectionObserver')}}</td> - <td> </td> - </tr> - </tbody> -</table> +{{Specifications}} <h2 id="浏览器兼容">浏览器兼容</h2> -<p>{{Compat("api.IntersectionObserver")}}</p> +<p>{{Compat}}</p> <h2 id="参考">参考</h2> |