Just had to do this in a skin and figured I would post my results (as I found no solution here for myself).
Just add the following code to your skin's .ascx file:
<!--[if lte IE 6]>
<script type="text/javascript">
//JS fix for PNGs in IE 5.5 and 6
var supersleight = function() {
var root = false;
var applyPositioning = true;
// Path to a transparent GIF image
var shim = '<%= SkinPath %>images/spacer.gif';
var fnLoadPngs = function() {
if (root) {
root = document.getElementById(root);
}else{
root = document;
}
for (var i = root.all.length - 1, obj = null; (obj = root.all[i]); i--) {
// background pngs
if (obj.currentStyle.backgroundImage.match(/\.png/i) !== null) {
bg_fnFixPng(obj);
}
// image elements
if (obj.tagName=='IMG' && obj.src.match(/\.png$/i) !== null){
el_fnFixPng(obj);
}
// apply position to 'active' elements
if (applyPositioning && (obj.tagName=='A' || obj.tagName=='INPUT') && obj.style.position === ''){
obj.style.position = 'relative';
}
}
};
var bg_fnFixPng = function(obj) {
var mode = 'scale';
var bg = obj.currentStyle.backgroundImage;
var src = bg.substring(5,bg.length-2);
if (obj.currentStyle.backgroundRepeat == 'no-repeat') {
mode = 'crop';
}
obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + mode + "')";
obj.style.backgroundImage = 'url('+shim+')';
};
var el_fnFixPng = function(img) {
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 = shim;
};
var addLoadEvent = function(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
};
}
};
return {
init: function() {
addLoadEvent(fnLoadPngs);
},
limitTo: function(el) {
root = el;
},
run: function() {
fnLoadPngs();
}
};
}();
// limit to part of the page ... pass an ID to limitTo:
// supersleight.limitTo('header');
supersleight.init();
</script>
<![endif]-->
Just replace "images/spacer.gif" with the location of a 1x1 transparent gif, or create an "images" folder in the skin's path and drop a 1x1 tranxparent gif in it named "spacer.gif".
The above code was taken mostly verbatim from 24ways.org.
This works very well with 24-bit alpha blended PNG files in the document as well as for PNGs as background images. It will not work on the :hover pseudo-class though.
Best regards,
Josh Thomas
http://AfterHoursTeleconsulting.com