Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Source/LazyLoad.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,19 @@ var LazyLoad = new Class({
this.container.addEvent("scroll", action);
},
loadImage: function(image) {
// Set load event for fadeIn
if(this.options.useFade) {
image.addEvent("load", function(){
image.fade(1);
});
var realSrc = image.get(this.options.realSrcAttribute);

if (realSrc !== null) {
// Set load event for fadeIn
if(this.options.useFade) {
image.addEvent("load", function(){
image.fade(1);
});
}

image.set("src", realSrc);
// Fire the image load event
this.fireEvent("load", [image]);
}
// Set the SRC
image.set("src", image.get(this.options.realSrcAttribute));
// Fire the image load event
this.fireEvent("load", [image]);
}
});