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

Does 'lazyload' support lazyloading of background images? #441

Open
jasomdotnet opened this issue Sep 30, 2019 · 6 comments
Open

Does 'lazyload' support lazyloading of background images? #441

jasomdotnet opened this issue Sep 30, 2019 · 6 comments

Comments

@jasomdotnet
Copy link

Does 'lazyload' support lazyloading of background images (css), like bLazy, for example? What about iframes?

@jasomdotnet jasomdotnet changed the title Does 'lazyload' support lazyloading of background images Does 'lazyload' support lazyloading of background images? Sep 30, 2019
@Soetens
Copy link

Soetens commented Oct 30, 2019

Yes it should;

<div class="lazyload" style="background-image: url('thumbnail.jpg')" data-src="original.jpg" />

@oleksii-sirochenko
Copy link

oleksii-sirochenko commented Dec 24, 2019

This works good
<div class="lazyload" style="background-image: url('thumbnail.jpg')" data-original="original.jpg" />

@bilogic
Copy link

bilogic commented Feb 11, 2020

While original.jpg is being loaded, thumbnail.jpg becomes invisible, causing a blank space in its place. Any idea how to overcome this?

@oleksii-sirochenko
Copy link

I guess it is the way it works. Just try to decrease load time of an original image.

@651584008
Copy link

这并不能实现背景图片的需求,因为他 style="background-image: url('thumbnail.jpg')"消失的太快,data-original="original.jpg" 还没加载结束,第一张图就消失了。导致第二张图的加载过程显示出来。从上到下一横一横的加载,加载表现和img标签的方式不一样,请问怎么改善

@slowhand11
Copy link

Hi, this doesnt work, what am i doing wrong? thumbnail.jpg will not be replaced at all.

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

No branches or pull requests

6 participants