Using WEBP with Magnific Popup

  Kiến thức lập trình

I have a simple HTML page using the following code to popup jpg images using Magnific Popup JS:

<li class="001">
<a href="images/large-image.jpg" class="002">
<div class="003">
<img src="images/thumbnail-image.jpg" alt="example alt-tag" />
</div>
<div class="004">
<h3 class="005">Photo Title Example</h3>
<p class="006">Longer description example about the photo here</p>
</div>
</a>
</li>

I would like to use WEBP images instead. I know the code to insert simple WEBP images on the page would be :

<picture> 
   <source type="image/webp"  srcset="images/thumbnail-image.webp"
   <img src="images/thumbnail-image.jpg" alt="example alt-tag" />
</picture>

Is there a way to adjust my codes to use WEBP with Magnific Popup JS ?

Have tried below:

<li class="001">
<a href="images/large-image.webp" class="002">
<div class="003">
<img src="images/thumbnail-image.webp" alt="example alt-tag" />
</div>
<div class="004">
<h3 class="005">Photo Title Example</h3>
<p class="006">Longer description example about the photo here</p>
</div>
</a>
</li>

New contributor

Kurt François is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT