luis-almeida / unveil

A very lightweight jQuery plugin to lazy load images
4.16k stars 676 forks source link

Picture element + different formats #152

Open koseduhemak opened 5 years ago

koseduhemak commented 5 years ago

Chrome does load jpg instead of webp even the webp is provided. Markup:

<picture>
    <source data-srcset="/dist/images/categories/historika_master.webp" type="image/webp">
    <source data-srcset="/dist/images/categories/historika_master.jpg" type="image/jpeg">
    <img src="/dist/loading.gif" data-src="/dist/images/categories/historika_master.jpg" class="card-img-top lazy-load category-slide" alt="Historika, Studentika, Militaria" title="Historika, Studentika, Militaria">
    <noscript>
        <img src="/dist/images/categories/historika_master.jpg" class=" card-img-top -slider category-slide" alt="Historika, Studentika, Militaria" title="Historika, Studentika, Militaria">
    </noscript>
</picture>

Is there anything I can do to force supported browsers to load the webp format?

vedmant commented 3 years ago

+1