schnuck schreef:
> anyone knows of a jquery plugin that fixes PNG transparency in IE 5.5, 6?
> or any ideas please?
>   
It's not a plugin, but i use this:

$(document).ready(function(){

    if (navigator.platform == "Win32" && navigator.appName == "Microsoft 
Internet Explorer") {
        fnLoadPngs();
    }

})


/**
 * Make images in IE6/IE5.5 transparent..
 */
function fnLoadPngs() {
    var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
    var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

    for (var i = document.images.length - 1, img = null; (img = 
document.images[i]); i--) {
        if (itsAllGood && img.src.match(/\.png$/i) != null) {
            var src = img.src;
            img.style.width = img.width + "px";
            img.style.height = img.height + "px";
            img.style.filter = 
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', 
sizingMethod='scale')"
            img.src = "img/x.gif";
        }
        img.style.visibility = "visible";
    }
}

(make sure that img/x.gif is available: it's just a 1x1 transparent 
pixel gif)


This can undoubtedly be cleaned up, but i never bothered.. (if it ain't 
broke, that sort of thing)

It's basically a quick hack to use an old-school PNG-fix script in my 
jquery sites.. The main advantage that i wanted to overcome is the gray 
flicker.. Because it's triggered in $(document).ready it shows the pngs 
correctly much quicker than when using onload.


Best regards, Bob.

>   
-- 
Bob den Otter - [EMAIL PROTECTED]
Two Kings - www.twokings.nl - 070 345 76 28

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to