We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
本系列文章是本人学习相关知识时所积累的笔记,以记录自己的学习历程,也为了方便回顾知识;故文章内容较为随意简练,抱着学习目的来的同学务必转移他处,以免我误人子弟~
GitHub:原生JS实现最简单的图片懒加载
关键原理: 将img标签的src设为空或占位图的地址,将真实的图片地址放在标签的data-*属性里面,在img元素滚动到可视区域后,src的值更新为data-*存放的值 未加载:<img src="./placeholder.jpg" data-src="./imgs/realimg.jpg" /> 已加载:<img src="./imgs/realimg.jpg" data-src="./imgs/realimg.jpg" />
<img src="./placeholder.jpg" data-src="./imgs/realimg.jpg" />
<img src="./imgs/realimg.jpg" data-src="./imgs/realimg.jpg" />
16c999e8c71134401a78d4d46435517b2271d6ac mojombo@16c999e8c71134401a78d4d46435517b2271d6ac mojombo/github-flavored-markdown@16c999e
#1 mojombo#1 mojombo/github-flavored-markdown#1
The text was updated successfully, but these errors were encountered:
zyhcool
No branches or pull requests
GitHub:原生JS实现最简单的图片懒加载
tagssupported16c999e8c71134401a78d4d46435517b2271d6ac
mojombo@16c999e8c71134401a78d4d46435517b2271d6ac
mojombo/github-flavored-markdown@16c999e
#1
mojombo#1
mojombo/github-flavored-markdown#1
The text was updated successfully, but these errors were encountered: