You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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' ) ) );
}
});
The text was updated successfully, but these errors were encountered:
zemzheng
changed the title
I need to know if the image load fail
I need an new option( onpreloaderror ) to see if it fail to load the image
Jul 20, 2015
zemzheng
added a commit
to zemzheng/jquery_lazyload
that referenced
this issue
Jul 20, 2015
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:
The text was updated successfully, but these errors were encountered: