emblewembl,
To set opacity in browsers that support the CSS 3 "opacity" propery, in Mozilla-based browsers (NN, Moz, FF, etc), and in Konqueror-based browsers (Konqueror, Safari, etc), you can use this syntax:
Code:
element.style.opacity = element.style.MozOpacity = element.style.KhtmlOpacity = (opacity / 100);
Where element is a pointer to your element, and opacity is a number between 0 and 100, representing the percentage of opacity you want (0 being totally transparent, 100 being totally solid).
MozOpacity and KhtmlOpacity refer to the proprietary "-moz-opacity" and "-khtml-opacity" styles, while "opacity" is simply the CSS 3 "opacity" style.
To set the opacity in IE, give your image an initial opacity using CSS:
Code:
#yourImageId {
filter: alpha(opacity=100);
position: relative;
}
and then you can use this script to set the opacity level:
Code:
element.filters.alpha.opacity = opacity;
As I mentioned before, you would use a timer (setTimeout or setInterval) to perform the fading over a period of time.
Hope this helps,
Dan
[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]