Skip to content

Commit

Permalink
Fix in Chrome: hide missing images with a js script
Browse files Browse the repository at this point in the history
git-svn-id: http://yourls.googlecode.com/svn/trunk@158 12232710-3e20-11de-b438-597f59cd7555
  • Loading branch information
ozh committed Sep 14, 2009
1 parent 6aad8df commit b98fe86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Binary file added images/blank.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions js/infos.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,12 @@ $(document).ready(function(){
$('#'+target).toggle();
return false;
});

// If an image src is erroneous (404 or anything) replace it with a transparent gif
$('.fix_images').each(function(i,img) {
$(img).error(function(){
$(img).attr('src', 'images/blank.gif');
});
});

});

0 comments on commit b98fe86

Please sign in to comment.