kaizau/Lazy-Load-Images-without-jQuery

Not worked if image has onyone class

Opened this issue · 1 comments

if image has anyone class exception "lazy-load" - it's not shown, but image is loaded
class lazy-loaded is not set after image load

try add any class name on demo page for example

img class="lazy-load test" src="demo/blank.gif" data-src-mobile="demo/mobile/1.jpg" data-src="demo/1.jpg"

Not elegant but fast desition

image.onload = function() {
var classes,key;
classes=this.className.split(' ');
for (key in classes){
if (classes[key]=='lazy-load')classes[key]='lazy-loaded';
}
this.className = classes.join(' ');
};