Hi!
I'm trying to make a transparent background in a table, but it's just
not working out for me! I've found this script on a site, hacked
version of sleight.js. Which I refer to in my html. It's kind of
working I guess, it seems it replaces my background.png by x.gif, but I
just can't figure out what I'm doing wrong and why this is happening.
Is it my png that is saved wrong or should I link differently to my
background-image?
if (navigator.platform == "Win32" && navigator.appName == "Microsoft
Internet Explorer" && window.attachEvent) {
window.attachEvent("onload", alphaBackgrounds);
}
function alphaBackgrounds(){
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (i=0; i<document.all.length; i++){
var bg = document.all[i].currentStyle.backgroundImage;
if (itsAllGood && bg){
if (bg.match(/\.png/i) != null){
var mypng = bg.substring(5,bg.length-2);
document.all[i].style.filter =
"progid:DXImageTransform.Microsoft.AlphaImageLoade r(src='"+mypng+"',
sizingMethod='scale')";
document.all[i].style.backgroundImage = "url('x.gif')";
}
}
}
}