lozad.js icon indicating copy to clipboard operation
lozad.js copied to clipboard

Improvement

Open jimblue opened this issue 6 years ago • 3 comments

Hi @ApoorvSaxena ,

I've just discovered an other library using intersection observer to lazyload image with some interesting approach.

You should have a look to the code some part of it could be interesting to improve lozad.js 😄

https://github.com/marlospomin/turtle/blob/master/src/turtle.js

Cheers

jimblue avatar Dec 09 '17 08:12 jimblue

@jimblue , what parts are you specifically mentioning of?

ApoorvSaxena avatar Jan 18 '18 19:01 ApoorvSaxena

How it load image here: https://github.com/marlospomin/turtle/blob/e0b07b186c08c8041771ac9df233adc6f2143980/src/turtle.js#L33

jimblue avatar Jan 19 '18 00:01 jimblue

What @jimblue mentions is true, the lozad library isn't preloading images, only settings attributes and acting accordingly. For example, loaded classes are set even when the image itself isn't loaded at all, yet. Preloading the src makes sense, really.

timocouckuyt avatar May 07 '19 17:05 timocouckuyt