Created
August 10, 2012 19:53
-
-
Save hansspiess/3317337 to your computer and use it in GitHub Desktop.
Frontend: Replace Text with image, No-Images-Fallback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1 { | |
background: url(image.gif); | |
height: 25px; | |
text-indent: -999em; | |
width: 250px; | |
overflow: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="muster" title="Muster">Muster</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkImages() { | |
if (document.getElementById) { | |
var x = document.getElementById('image').offsetWidth; | |
if (x != '250') { | |
document.getElementById('image').style.textIndent = '0'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment