Skip to content
New issue

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

test issue #1

Closed
3 of 4 tasks
zyhcool opened this issue Apr 29, 2019 · 0 comments
Closed
3 of 4 tasks

test issue #1

zyhcool opened this issue Apr 29, 2019 · 0 comments
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@zyhcool
Copy link
Owner

zyhcool commented Apr 29, 2019

本系列文章是本人学习相关知识时所积累的笔记,以记录自己的学习历程,也为了方便回顾知识;故文章内容较为随意简练,抱着学习目的来的同学务必转移他处,以免我误人子弟~

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" />

  • @mentions, #refs, links, formatting, and tags supported
  • list syntax required (any unordered or ordered list supported)
  • this is a complete item
  • this is an incomplete item

16c999e8c71134401a78d4d46435517b2271d6ac
mojombo@16c999e8c71134401a78d4d46435517b2271d6ac
mojombo/github-flavored-markdown@16c999e

#1
mojombo#1
mojombo/github-flavored-markdown#1

@zyhcool zyhcool added duplicate This issue or pull request already exists enhancement New feature or request labels Apr 29, 2019
@zyhcool zyhcool self-assigned this Apr 29, 2019
@zyhcool zyhcool pinned this issue Apr 29, 2019
@zyhcool zyhcool unpinned this issue Apr 29, 2019
@zyhcool zyhcool closed this as completed Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant