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 <picture> source media? #447

Open
eugenyshiryaev opened this issue Apr 7, 2020 · 2 comments
Open

Does lazyload support <picture> source media? #447

eugenyshiryaev opened this issue Apr 7, 2020 · 2 comments

Comments

@eugenyshiryaev
Copy link

eugenyshiryaev commented Apr 7, 2020

<picture> <source media="(max-width: 500px)" srcset="/img/1_small.png"> <img src="/images/1x1.png" class="lazyload" data-src="/img/1.jpg" style="width: 100%;" height="100%"> </picture>

How to make 1_small.png lazyload?

@Knyaz71
Copy link

Knyaz71 commented Dec 21, 2020

Попробовать заменить в 120 строке:
} else {
на
} else if ("source" === entry.target.tagName.toLowerCase()) { if (srcset) { entry.target.srcset = srcset; } } else {

и в 145 строке:
} else {
на
} else if ("source" === image.tagName.toLowerCase()) { if (srcset) { image.srcset = srcset; } } else {

@passioneight
Copy link

passioneight commented Jul 27, 2022

Doesn't seem like it does. Any chance we can get support for this?

Update: if anyone else comes across this - here's an alternative: https://github.com/verlok/vanilla-lazyload

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

3 participants