Object expected error
Hi,
I have a script in my web page that runs a cross browser transition effect. It works perfectly in FF and well in IE as long as the option to display script errors is off. If script errors is on I get a "Object expected" error relating to this line:
var object = document.getElementById(id).style;
which is generating a null value. Being a perfectionist I would like to be able to remove the bug. The line of code belongs to this function which checks for the various browser transition functions:
//change the opacity for different browsers
function changeOpac(opacity, id) {
var object = document.getElementById(id).style;
object.opacity = (opacity / 95);
object.MozOpacity = (opacity / 95);
object.KhtmlOpacity = (opacity / 95);
object.filter = "alpha(opacity=" + opacity + ")";
}
id refers to the image element the effect is applied to. opacity is a number defining the current level of opacity.
Any help would be much appreciated.
Thank you,
Steve
__________________
\"I will prepare and one day my chance will come.\"
|