Quantcast
Channel: Zenphoto forum
Viewing all articles
Browse latest Browse all 2917

SRC= to DATA-SRC= converter for lazy loading thumbnails

$
0
0

Hello!
Trying to introduce lazy loading feature on theme's album.php for heavy weighted thumbnails. There are a lot of scripts on the net, helping this approach. Examples: b-lazy responsivelyLazy ...
b-lazy uses following html:

<img class="b-lazy"
         src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
         data-src="images/image.jpg" 
         alt="alt-text"
    />
responsivelyLazy:
<img class="responsively-lazy"
         src="images/image.jpg
                 srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" 
         data-srcset="images/400.jpg 400w, images/400.webp 400w, images/600.jpg 600w, images/1000.jpg 1000w"
         alt="alt-text"
    />
Both replacing attribute src with data-src or srcset and data-srcset for lazy needs. How do i use these scripts with ZP functions like printImageThumb()? Here is the example of lazyload converter for WordPress but howto implement it into Zenphoto?

Viewing all articles
Browse latest Browse all 2917

Trending Articles