Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by Design Pesendorfer for Animate native lazy load image (loading='“lazy”)

I managed to use a simple jQuery solution, since its already used in my case:

 //fade in lazy loaded images $('article img').on('load', function(){    $(this).addClass('loaded'); });

The images have 0 opacity by default and opacity 1 from the new class

img{    opacity: 0;    transition: opacity 300ms ease-in-out;}img.loaded{    opacity: 1;}

This is not graceful as users w/o JS wont see the images ... but frankly i don't care ^^ To be honest, who has JS disabled?


Viewing all articles
Browse latest Browse all 3

Trending Articles