dinbror / blazy

Hey, be lazy! bLazy.JS is a lightweight pure JavaScript script for lazy loading and multi-serving images. It's working in all modern browsers including IE7+.
http://dinbror.dk/blazy
MIT License
2.63k stars 355 forks source link

Load images into 'pseudo' element #144

Open WhereJuly opened 7 years ago

WhereJuly commented 7 years ago

Hey Bjørn, me again.

I face many websites I make having a lot of decorative images being put into pseudo elements. Usually they are the extra parts of images bursting through the block elements' borders merely positioned absolute. These images usually have to be made .png. Due to their decorative nature they require transparency. Therefore they are of quite heavy weight (some around 100kB).

Would it be possible to add loading the data-src value into before/after element? Say like making it data-src-before / data-src-after. It could add some more value to the already quite a sound Blazy thing.

All the best, Val