Helpful Information
 
 
Category: vBulletin 3.7 Template Modifications
Forum Home Enhancements - fix png transparency

this code fix the png transparency problems whit ie5 and ie 6

this is very simple:
in the header template add this code very top:



<!--[if gte IE 5.5000]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 or higher.
{
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 + "\');\"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->





If you Like This Mod Mark INSTALLED (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=180509)

enjoy

Install!!

thank you for that! :)

ty sir! *installed

Does this work with 32 bit PNG images as well?

Any problems with width/height going crazy? I've tried other png ie fixes that worked but had issues.

This solution is more elegant, less resource intensive and still valid:

http://www.vbulletin.org/forum/showthread.php?t=94416

Just by placing the javascript in an external file, you can significantly reduce page load and bandwidth simply because its cached in the end-user's browser. Not only that but IE7 and IE8 do not need this applied to PNG images since they support the Alpha Transparency natively.

Install, Very Nice!

it doesn't work with mine. help!

doesn't work for me

thanks

installed










privacy (GDPR)