View Single Post
Old 11-15-2005, 10:55 PM   #2 (permalink)
spectre
Junkie
 
I did a quick google and here's what I found.
You're going to want to copy and paste this part inside of your <head> </head> tags:
Code:
<!--[if gte IE 5.5000]>
   <script language="JavaScript"> var ie55up = true </script>
<![endif]-->
<script language="JavaScript">
function fixPNG(myImage) // correctly handle PNG transparency in Win IE 5.5 or higher.
   {
    if (window.ie55up)
	 {
	 var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	 var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	 var imgTitle = (myImage.title) ? "title='" + myImage.title + "' " : "title='" + myImage.alt + "' "
	 var imgStyle = "display:inline-block;" + myImage.style.cssText 
	 var strNewHTML = "<span " + imgID + imgClass + imgTitle
	 strNewHTML += " style=\"" + "width:" + myImage.width + "px; height:" + myImage.height + "px;" + imgStyle + ";"
	 strNewHTML += "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
	 strNewHTML += "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>" 
	 myImage.outerHTML = strNewHTML
	 }
   }
</script>
And for the image itself:
Code:
<img src="your.png" height="15" width="21" onload="fixPNG(this)">
where your.png is your png file. And yes, you must include the height and width in the img tag.
__________________
"Fuck these chains
No goddamn slave
I will be different"
~ Machine Head

Last edited by spectre; 11-15-2005 at 11:02 PM..
spectre is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57