I just so happened to write one tonight :-) Not completely finished (any 
improvements let me know, especially about the $(this) parts) but here 
it is:

(function($) {
    $.fn.fixPNG = function()
    {
        if($.browser.msie)
        {
            var agent = navigator.userAgent.toLowerCase();
            if(parseFloat(agent.substr(agent.indexOf('msie') + 5, 3)) > 6)
            {
                return(false);
            }
        }
        else
        {
            return(false);
        }

        $(this).each(function()
        {
            if($(this).attr('src').indexOf('.png') != -1)
            {
                var t = $(this);
                var imgSrc = $(t).attr('src');
                var w = $(t).attr('width') + 'px';
                var h = $(t).attr('height') + 'px';

                $(t).css({filter : 
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgSrc + 
"', sizingMethod='scale')"}).attr({src : '/images/spacer.gif', width: w, 
height: h})
            }
        });
    };
})(jQuery);

$(function()
{
    $('img').fixPNG();
});

schnuck wrote:
> anyone knows of a jquery plugin that fixes PNG transparency in IE 5.5, 6?
> or any ideas please?
>
> tia,
>
> s
>
>   

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

Reply via email to