Open
Description
In my case I need to know if it fail to load the image.
I put the image in CDN, and if there is something wrong with CDN sync, I need to use the local image instead.
So I think it would be useful to add an option : onpreloaderror. EXP:
function swap2LocalImage( cdn_url ){
// return the image url in local
}
$( 'img' ).lazyload({
placeholder : './img-default.png',
data_attribute : 'src',
onpreloaderror : function(){
var $this = $( this );
$this.attr( 'src', swap2LocalImage( $this.data( 'src' ) ) );
}
});
Metadata
Metadata
Assignees
Labels
No labels