Nuno
Well-known member
Hello,
I hate to see posts with broken images, so I end up using a simple jquery script that I found in stackoverflow to replace the error image with a placeholder:
So, before </body> add:
Don't forget to upload the placeholder image to your server!
I placed this in the suggestion forum so this can be added to the default theme and because I don't have privileges to posts this in the tips section
I hate to see posts with broken images, so I end up using a simple jquery script that I found in stackoverflow to replace the error image with a placeholder:
So, before </body> add:
Code:
<script>
jQuery("img.bbCodeImage").one('error', function () {
jQuery(this).attr("src", "/styles/default/xenforo/placeholder.jpg");
}).each(function () {
if (this.complete && !this.naturalHeight && !this.naturalWidth) {
$(this).triggerHandler('error');
}
});
</script>
Don't forget to upload the placeholder image to your server!
I placed this in the suggestion forum so this can be added to the default theme and because I don't have privileges to posts this in the tips section
Attachments
Upvote
8