//loading photo
jQuery.fn.LoadImage = function(fn){
return this.each(function(){
var src = this.src;
this.src = '';
this.onload = function(){
this.onload = null;
fn.call(this);
};
this.src = src;
});
}
//loading photo
jQuery.fn.LoadImage=function(fn){
return this.each(function(){
var self = $(this);
var src = self.attr("src");
var img = new Image();
img.src = src;
alert(img.src);
if(img.complete){
img.width > 0 ? fn.call(img) : '';
return;
}
self.attr("src","");
$(img).load(function(){
self.attr("src",this.src);
fn.call(img);
});
});
}
loading