View Full Version : looks bad in IE, sugguestions?

04-18-2005, 02:32 AM

Well since IE doesn't support transparent pngs is there anyway to get the left and right border to look good? Any way to have a flash file with the png in it and transparent background auto-size to the height of the content? Any other sugguestions?

It looks the way it is supposed to in FireFox, stupid IE

04-18-2005, 02:42 AM
You can use png file in IE6. I did!

First put this file in your websites root directory and name it pngfix.js Here's the code, just copy it paste it into a new test file and change the name to pngfix.js

// Correctly handle PNG transparency in Win IE 5.5 or higher.
// http://homepage.ntlworld.com/bobosola. Updated 02-March-2004

function correctPNG()
for(var i=0; i<document.images.length; i++)
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
img.outerHTML = strNewHTML
i = i-1
window.attachEvent("onload", correctPNG);

Next ... in the head section of your webpage put this:

<!--[if gte IE 5.5000]>
<script type="text/javascript" src="pngfix.js"></script>

If you don't believe me .. you can see it for real on my site http://handler.homeip.net/test1.php The logo at the top is a png graphic!

Hope this help! :thumbsup:

04-18-2005, 03:25 AM
Ahh it sounds like the solution to my last remaining problem!!...

only i tried it and it didn't work :( Any ideas? Thanks,
-Jesse (I left the code up on the site if u wanna check for errors, but i pasted it exactly and even tried dloading the one from your site and substituting that but no luck so im lost)

04-18-2005, 05:08 AM
I think I neglected to supply something. Stick this class inside of your img tag.
class="pagegraphic" See if that works. Here's the link to where I got this code from. http://homepage.ntlworld.com/bobosola/index.htm :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum