ivopetkov / responsively-lazy

Lazy load responsive images and HTML
https://ivopetkov.com/responsively-lazy/
1.1k stars 43 forks source link

Src is always downloaded #20

Closed Kcko closed 6 years ago

Kcko commented 6 years ago

This solution has a one unresolved behavior. Each browser downloads image in src before when plugin switch image in data-src.

In your example each browser download 2000px image and after then decides what to replace and show. i think that is not very useful to insert a large picture like a fallback.

Try to mention this behavior in readme.md

ivopetkov commented 6 years ago

Only the browsers that do not support the srcset attribute load the value in the src attribute. That's why the srcset="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" part is so important. You can read more about this at http://ivopetkov.com/b/lazy-load-responsive-images/

Kcko commented 6 years ago

Ok thx :-)