From 3cf05e8430ed250f0bb963b3d1e859df519ba637 Mon Sep 17 00:00:00 2001 From: "wangkai.1997" Date: Sun, 29 Sep 2024 10:35:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=8D=9A=E5=AE=A2toc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...10-29-IntersectionObserver\347\224\250\346\263\225.md" | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git "a/blog/2022-10-29-IntersectionObserver\347\224\250\346\263\225.md" "b/blog/2022-10-29-IntersectionObserver\347\224\250\346\263\225.md" index 4d24e45f..fc079f84 100644 --- "a/blog/2022-10-29-IntersectionObserver\347\224\250\346\263\225.md" +++ "b/blog/2022-10-29-IntersectionObserver\347\224\250\346\263\225.md" @@ -12,8 +12,6 @@ authors: oxygen -# IntersectionObserver 介绍 - W3C 在 [2017-09-14](https://www.w3.org/standards/history/intersection-observer) 正式发布了`IntersectionObserver` API 草案,其功能上提供了检测目标元素在祖先元素或 [viewport](https://developer.mozilla.org/zh-CN/docs/Glossary/Viewport) 内可视情况变化的方式,这种观测是异步的,保证了开发上的便捷和性能上的高效。 ## IntersectionObserver类型定义 @@ -169,7 +167,9 @@ interface IntersectionObserverEntry { ::: -## 判断元素是否可见 +## IntersectionObserver用例 + +### 判断元素是否可见 通过`IntersectionObserver`我们可以判断元素是否可见的两种情况: @@ -195,8 +195,6 @@ interface IntersectionObserverEntry { sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts" loading="lazy" > -## IntersectionObserver用例 - ### Image Lazyload