Possibly crying for the moon here, but I’d like to be able to use Javascript and css to gradually fade an image. IE and Mozilla handle opacity differently:
style=”opacity:0.4;filter:alpha(opacity=40)”
The ‘filter’ option is IE. Using a timer and a for loop, I’d like to substitute the two values with variables and gradually fade them. Here’s a code snippet that fails miserably in IE (without the timer and for loop):
function fadeaway()
{
var element = document.getElementById(‘howdense’);
var density = 50;
element.style.filter=alpha(opacity=density);
}
Any ideas, please?