搜索elementui:Element - The world's most popular Vue UI framework
background MDN:background - CSS:层叠样式表 | MDN
css font MDN:font - CSS:层叠样式表 | MDN
srcset MDN:HTMLImageElement.srcset - Web API 接口参考 | MDN
npmjs.com
滚动事件触发:chapter3/demo3.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>懒加载处理</title>
<style>
img {
width: 200px;
height: 100px;
display: block;
}
</style>
</style>
</head>
<body>
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
<img src="https://www.baidu.com/img/bd_logo1.png" data-url="./01.jpg" alt="">
</body>
<script>
// 获取到所有的img元素
let imgs = document.querySelectorAll('img');
document.body.onscroll = function(){
console.log('滚动事件触发')
}
</script>
</html>
效果演示: