当前位置:网站首页>Better performance and simpler lazy loading of intersectionobserverentry (observer)
Better performance and simpler lazy loading of intersectionobserverentry (observer)
2022-07-29 07:33:00 【Moon and stars】
( The following are personal understandings used in the project , If you have any mistakes, please correct them )
IntersectionObserverEntry It is used to observe the interaction degree of two nodes
One 、 Get the observed node
Triggered when the observed node enters the visual interface
var target = document.getElementById('xxx')
Two 、 Create observers
var loadingObserver = new IntersectionObserver(ObserverList=>{
// ObserverList Is an array of observed nodes , Of each of these elements isIntersecting Represents entry or exit
if(ObserverList[0].isIntersecting){
console.log(' Being loaded ...')
}
},{
// The degree to which the two goals overlap
threshold: 0.1,
// root by null Or when not writing, it defaults to the browser visual interface
root: null
})
3、 ... and 、 Add the observed target
// target Will be inserted above ObserverList in
loadingObserver.observe(target)
// Multiple can be added
loadingObserver.observe(target1)
loadingObserver.observe(target2)
边栏推荐
- Life cycle hooks in routing - activated and deactivated
- Docker's latest super detailed tutorial - docker creates, runs, and mounts MySQL
- QT基础第二天(2)qt基础部件:按钮类,布局类,输出类,输入类,容器等个别举例
- Some learning and understanding of vintage analysis
- Meizhi optoelectronics' IPO was terminated: annual revenue of 926million he Xiangjian was the actual controller
- logback filter过滤器简介说明
- Synchronous / asynchronous, blocking / non blocking and IO
- do end用法的妙处
- 08 dynamic programming
- Meeting notice of OA project (Query & whether to attend the meeting & feedback details)
猜你喜欢

Sqlmap(SQL注入自动化工具)

如何与斯堪尼亚SCANIA建立EDI连接?

QT连接两个qslite数据库报错QSqlQuery::exec: database not open

1 - background project construction

RoBERTa:A Robustly Optimized BERT Pretraining Approach

Can the subset of the array accumulate K

QT basic day 2 (2) QT basic components: button class, layout class, output class, input class, container and other individual examples

利用C语言巧妙实现棋类游戏——三子棋

Android面试题 | 怎么写一个又好又快的日志库?

QT专题:基础部件(按钮类,布局类,输出类,输入类,容器类)
随机推荐
2-unified return class dto object
我,28岁,测试员,10月无情被辞:想给还在学测试 的人提个醒......
[summer daily question] Luogu P6500 [coci2010-2011 3] zbroj
1-后台项目搭建
MySQL uses the client and select methods to view the summary of blob type fields
stm32 操作W25Q256 W25Q16 spi flash
在线问题反馈模块实战(十七):实现excel模板在线下载功能
Levelfilter introduction
JS day 4 process control (if statement and switch statement)
RoBERTa:A Robustly Optimized BERT Pretraining Approach
Leetcode 209. subarray with the smallest length (2022.07.28)
新生代公链再攻「不可能三角」
状态机dp三维
Docker's latest super detailed tutorial - docker creates, runs, and mounts MySQL
Job 7.28 file IO and standard IO
09 bloom filter
Log4qt memory leak, use of heob memory detection tool
Pat class a 1154 vertex shading
【暑期每日一题】洛谷 P4414 [COCI2006-2007#2] ABC
Can I specify memory parameters in SQL statements?