I am a bit confused how to use the picture fallback solution in combination with jquery lazyload. I use this library:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
At the moment my images are integrated like this:
<img class="center lazy" data-original="./bilder/uebersetzung-marketing-bwl.png" width="593>
But webp fallback solution is structured like this:
<picture>
<source class="center lazy" srcset="./bilder/Uebersetzungsdienst-Jena-BM-Translations.webp" type="image/webp">
<img class="center lazy" src="./bilder/Uebersetzungsdienst-Jena-BM-Translations.png" width="1920" height="97" alt="Uebersetzungsdienst-Jena-BM-Translations">
</picture>
My question:
the integrated lazyload looks for data-original so it does not work with srcset. Is there a solution for that?
If possible I would prefer to do not use another library but "simply" add some code.
I've found the solution.It is required to add data in specific format with custom attribute. this code work perfectly and help for page optimization you add web or other format images.
Note: All format images with same name like,
Just change extension not name
Lazy loading is now working perfectly.