Legitcode / image

an img tag, with lazy loading
http://legitcode.github.io/image/
47 stars 0 forks source link

Protocol-less images doesn't fade in #8

Open rexxars opened 8 years ago

rexxars commented 8 years ago

I'm not quite sure what the intention was with the first part of this line:

if(!src.match(/http/) || typeof window === 'undefined') opacity = 1

Basically that means you won't get fading images for:

agunescu commented 7 years ago

I am not quite sure what's the intention on the second part, why checking for window undefined? Also I don't see the lazy load part, where are you using data-src?

zackify commented 7 years ago

We check for window undefined in case of a server render. Sorry, somehow I missed these emails.