toddmotto / echo

Lazy-loading images with data-* attributes

Home Page:http://toddmotto.com/labs/echo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not all images are shown

ChristianGiupponi opened this issue · comments

I have add data-echo to all my images but most of the time just the first image is shown while the other still show the loader.

This is my html:

<div class="image">
    <img src="img/loader-img.gif" data-echo="img/example.jpg" alt="title">
</div>

and this is my code:

echo.init({ 
        offset: 100, 
        throttle: 250, 
        unload: false, 
        callback: function (element, op) { 
            $(element).parent().closest('div').addClass('imgLiquidFill imgLiquid');
            $(".imgLiquidFill").imgLiquid(); 
        } 
     }); 

the callback are called just once, so only the first element will add the imgLiquid class.
How can I solve?