How do I make use of clear PNGs in IE6?
Just how do I make use of clear PNGs in IE6? I have a company application that has to make use of IE6 and also has to make use of usage PNGs, yet the transparency all comes via as a light white colour.
IE6 sustains clear (yet not transparent) PNG's out of package. The PNG simply needs to be conserved in the PNG8 layout. If all you require is a clear history and also not a mixing result you do not require any kind of code. Simply conserve as PNG8.
If you're ALRIGHT with GIF - like transparency (in IE6 just), after that make use of PNG8+Alpha (paletted, yet with semitransparencies).
It offers complete alpha in all various other internet browsers. Does not call for slow-moving and also particular DX Filters (on which all IE6 PNG24 solutions are based upon).
Fireworks and also pngnq
/ pngquant
can conserve this layout (I created Mac GUI for them).
Adobe Photoshop is the only remarkable software program that does not sustain it, yet you can export PNG24 and afterwards transform it.
There is a jQuery plugin for it here, or the adhering to manuscript additionally does an excellent work (simply call it in your <body onload="">
;
function fixPNG(){
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (version < 7) && (document.body.filters))
{
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
}
}
}
}
24 means has a well - created write-up on this concern:
Related questions