Picture tag
-
Does the plugin support picure tags?
I read from other notes:
If you have images output in custom templates or want to lazy load other images in your theme, you may pass the HTML through a filter:
<?php $img_html = '<img src="myimage.jpg" alt="">'; $img_html = apply_filters( 'bj_lazy_load_html', $img_html ); echo $img_html; ?>
What code should I use to lazy load these images in my theme?
<picture> <!--[if IE 9]><video style="display: none;"><![endif]--> <source srcset="myimage.jpg" media="(min-width: 1200px)"> <source srcset="myimage-960.jpg" media="(min-width: 960px)"> <source srcset="myimage-640.jpg" media="(min-width: 640px)"> <source srcset="myimage-480.jpg" media="(min-width: 480px)"> <!--[if IE 9]></video><![endif]--> <img src="myimage-480.jpg" alt=""> </picture>
- The topic ‘Picture tag’ is closed to new replies.