rnmp / salvattore

A jQuery Masonry alternative with CSS-driven configuration.
https://salvattore.js.org/
MIT License
2.17k stars 243 forks source link

Salvattore and Lazyload #215

Open RChrisE opened 5 years ago

RChrisE commented 5 years ago

I use Salvattore to create a gallery dynamically. As the gallery is quite large, I'd like to use lazyload. But with Salvattore all the images are loaded, not only the ones above the fold.

I'm using lazyload 10.20 in a JTL Shop backend. The php(smarty)/html:

<div id="grid" data-columns>
{foreach name=Links from=$linkgroups->inspirationen->Links|@array_reverse item=Links}
    {assign var=imgNo value=$Links->nSort}
        <a href="/{$Links->URL}" class="img-box">
            <img class="lazy" src="" data-src="/mediafiles/Bilder/Inspirationen/{$imgNo}.jpg">
            <img class="hidden zaehler-container" src="/bilder/Testbilder/ecke.svg" />
            <span class="hidden zaehler">{$imgNo}</span>
        </a>
{/foreach}
</div>

Thanks