File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ authors: oxygen
12
12
13
13
<!-- truncate-->
14
14
15
- # IntersectionObserver 介绍
16
-
17
15
W3C 在 [ 2017-09-14] ( https://www.w3.org/standards/history/intersection-observer ) 正式发布了` IntersectionObserver ` API 草案,其功能上提供了检测目标元素在祖先元素或 [ viewport] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Viewport ) 内可视情况变化的方式,这种观测是异步的,保证了开发上的便捷和性能上的高效。
18
16
19
17
## IntersectionObserver类型定义
@@ -169,7 +167,9 @@ interface IntersectionObserverEntry {
169
167
170
168
:::
171
169
172
- ## 判断元素是否可见
170
+ ## IntersectionObserver用例
171
+
172
+ ### 判断元素是否可见
173
173
174
174
通过` IntersectionObserver ` 我们可以判断元素是否可见的两种情况:
175
175
@@ -195,8 +195,6 @@ interface IntersectionObserverEntry {
195
195
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
196
196
loading="lazy"
197
197
> </iframe >
198
- ## IntersectionObserver用例
199
-
200
198
### Image Lazyload
201
199
202
200
<iframe src="https://codesandbox.io/embed/hopeful-poincare-uuhiob?fontsize=14&hidenavigation=1&theme=dark"
You can’t perform that action at this time.
0 commit comments