Unable to get srcset to work as expected
See original GitHub issueUsing version 1.2.2 with Vue 2.5.15
I’m not able to get srcset to work as expected. The following output without your plugin works as expected in Chrome:
<img
srcset="http://via.placeholder.com/180x150 180w,http://via.placeholder.com/250x150 250w,http://via.placeholder.com/350x150 350w,http://via.placeholder.com/500x150 500w"
sizes="(min-width: 1024px) 48.828125vw,(min-width: 768px) 45.57291666666667vw,100vw">
When replacing srcset
with data-srcset
and adding v-lazy="'http://via.placeholder.com/180x150'"
the 180x150
image is always shown. What do I oversee? Why is data-srcset
not just converted to srcset
when the image needs to be loaded and let the browser do the calculation (I know there would have to be a polyfill for older browsers)?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:30 (8 by maintainers)
Top Results From Across the Web
responsive images srcset not working - Stack Overflow
Im using chrome 40 and all I get is the largest image, resizing my browser, clearing the cache does nothing. I read somewhere...
Read more >srcset not working? Getting Wrong Images? Let's Find Out Why!
Sometimes, when srcset is not working and the browser is using the wrong image, it can be frustrating. This guide will help you...
Read more >The Media or Image Source element - HTML - MDN Web Docs
It is a void element, meaning that it has no content and does not have a closing tag. It is commonly used to...
Read more >Picture perfect images with the modern <img> element
Use srcset + efficient modern image formats; Avoid wasting pixels (compress, don't serve overly high DPR images); Lazy-load offscreen images ( ...
Read more >Responsive Images: If you're just changing resolutions, use ...
If you want, you can get all kinds of specific about it. You can use sizes to match your CSS layout exactly and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This has been around for quite a while and is definitely of a reason not to use this plugin anymore… Is there anyone who got this problem solved?
You can use adapter to make data-srcset work i guess It seems that lazyload don’t change data-srcset to srcset by default
`
`