1

If the logo.png picture is not available, then it is hidden along with the logo from css.

<div class="logo">
<img  src="logo.png" onerror="this.onerror=null;style='display:none;'"/>
</div>

Example http://jsfiddle.net/dzanis/t5Lg2ay0/

TODO The question is solved by replacing the transparent image

<div class="logo">
<img  src="logo.png" onerror="this.src='data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=='"/>
</div>

http://jsfiddle.net/dzanis/dex1m47L/

dzanis
  • 489
  • 5
  • 6

1 Answers1

3

Try this way

<img src="http://aqualight.atspace.eu/logo.pngs" onerror='this.style.display = "none"' />

Using CSS

function onImgError(ev) {
  ev.className = "error";
}
img {
  height: 100px;
}

.error {
  display: none;
}
<img src="http://www.twentyonepilots.com/sites/g/files/g2000004896/f/Sample%202_0.jpdg" onerror='onImgError(this)' />
Nidhin Joseph
  • 9,981
  • 4
  • 26
  • 48