lazysizes
lazysizes copied to clipboard
Always loading largest size
We have implemented lazy sizes on the header image here: https://www.star-registration.com/pages/sympathy-gift-for-funeral unfortunately, it always loads the 900px image no matter the device width.
I already tried to remove all css classes, set data-aspectratio and every other quickfix that can be found on the internet. Any help would be appreciated
You need to either replace src
with data-src
(see https://github.com/aFarkas/lazysizes/tree/5.3.1#combine-data-srcset-with-data-src) or add an empty placeholder image in srcset
(see https://github.com/aFarkas/lazysizes/tree/5.3.1#modern-transparent-srcset-pattern). Otherwise the browser will always load what it finds in src
.