vendredi 22 avril 2016

Prevent layout change for BBC Imager lazy loaded content

BBC Imager is a solution for responsive image loading. It works by having placeholders. The library looks up these divs, converts them to transparent images and updates the src attribute for each image by applying the best image URL.

A side effect of using such libraries on pages with many images, is that the page layout is being changed before the images are loaded.

How can I use BBC Imager and avoid the reflow layout side effect? I'd like to show grey placeholder images, prior to the real image taking its place.

<div style="width: 240px">
    <div class="delayed-image-load" data-src="http://ift.tt/1oCHZUD}" data-alt="alternative text"></div>
</div>




Aucun commentaire:

Enregistrer un commentaire