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

后台文章编辑器预览文章图片追加loading="lazy" #1735

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jrotty
Copy link
Contributor

@jrotty jrotty commented Feb 19, 2024

后台文章编辑器预览文章图片追加loading="lazy"支持浏览器原生懒加载加载
Fix #1727

后台文章编辑器预览文章图片追加loading="lazy"支持浏览器原生懒加载加载
typecho#1727
Copy link
Member

@joyqi joyqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要确定加入懒加载以后,对全屏状态下的左右文章实时滚动,是否会产生影响。

因为图片加载后会撑高原有内容,可能会产生位移。

@jrotty
Copy link
Contributor Author

jrotty commented Feb 29, 2024

看了这篇文章,虽说这个原生懒加载不仅仅只加载当前窗口的图片,但仍然避免不了滚动过快看到未加载的图片,从而导致布局偏移的问题,除非提前给img写上宽度高度
https://web.dev/articles/browser-level-image-lazy-loading?hl=zh-cn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

在编辑文章时,会默认加载所有图片,大图多了导致编辑时很慢
3 participants