It is so easy to correct broken png issues in IE 5.5 and up.
If we take for granted that RC will only work in newer browsers anyways (I
haven't even tried RC in IE5 or NS6 for instance), then what's the issue
with including the little javascript function below to fix it once and for
all?
[code]
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);
[/code]
This will, as far as I've been able to tell, correct transparency issues in
IE every single time.
Michiel
On Fri, 17 Aug 2007 10:26:41 +0200, till <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On 8/17/07, Chris Fordham <[EMAIL PROTECTED]> wrote:
>> png transparency only fails in IE6 and below, not IE7
>> you can do larger than 256 colour gifs, but they are not lossless
>> size is not really comparable because it depends on how many colours are
>> being used - png uses selectable palette
>
> No, it is still broken in IE7. At least it doesn't work a 100%. Which
> renders using PNGs useless for me.
>
> Till
> _______________________________________________
> List info: http://lists.roundcube.net/dev/
_______________________________________________
List info: http://lists.roundcube.net/dev/