terrymun / Fluidbox

Replicating and improving the lightbox module seen on Medium with fluid transitions.
http://terrymun.github.io/Fluidbox/
Other
2.15k stars 166 forks source link

How to make Fluidbox works with Lazysizes #180

Closed l2aelba closed 8 years ago

l2aelba commented 8 years ago

I just made a tuturial + tricks here (Since many issues about this)

I will show how to get it work with https://github.com/aFarkas/lazysizes

HTML :

<a class="lazy-fluidbox" href="#"><img class="lazyload" data-src="#"></a>

JS :

document.addEventListener('lazybeforeunveil', function(e){
    // Fluixbox
    setTimeout(function(){
        $(e.target).parent('.lazy-fluidbox').fluidbox({loader:true}); 
    },100);
});

Done !

Any better trick, so just well come

terrymun commented 8 years ago

Thanks for the suggestion. It is probably useful for others who are working with Lazysizes, even though there have been no reported issues about integrating the two.

I believe it's a matter of implementation and not a bug itself, so I will be closing this.

l2aelba commented 8 years ago

@terrymun Yep, just close this. Maybe I useful for someone who's searching

olafgleba commented 4 years ago

Sadly this doesn't work when using data-srcset (instead of data-src). And i am afraid i have no solution to this so far.