views:

996

answers:

1

hi,

I'm trying to render a .png background image in ie6 after a mootools onclick event which changes the background image of a logo div.

here is the relevant code as it is just now-

if(!window.ie6){
    $('logo').setStyle('background-image', imagePath);
}else{
    $('logo').setStyles({
    filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+imagePath+")"
    });
}

this, for whatever reason, doesn't seem to work! the event is called and works fine for all other browsers but the logo is just blank when this runs in ie6.

If anyone could shed some light on this, or has any ideas, I would be much obliged.

Cheers, peter

+1  A: 

have you tried saving your PNG's as PNG8 instead? this way you can gracefully handle IE6. saves all that alpha load hassel.

futher, why not try and write your css in conditional stylesheets ands simply change the class (or add more on) of the item in question rather than its inline attributes.

http://www.sitepoint.com/blogs/2008/03/20/making-ie6-friendly-png8-images/

nickmorss