Object properties between browsers - layer opacity/visibility problems
In this case I've got a series of layers that correspond to some links. When someone mouses over the link, the layer becomes visible. When someone mouses out, I want the layer to fade out.
It works perfectly in IE, but I want to get in working in Netscape and Mozilla. I've tried altering the code in many ways (ignore the rudimentary attempt at detection, which I've removed to test Netscape/Mozilla) but the function doesn't seem to work with Netscape and Mozilla. The layer will go visible when mousing over, and then just stay there... hurray. Nothing I've tried will animate the opacity. Can anyone help me?
//fades the layer out
ie5 = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);
//starts opacity at 100% and function stopper to 0
lopac = 100;
//fades the layer out while opacity is greater than 0 and while function stopper is 0
if(lopac > 0)
if(ie5) document.getElementById('layerval').filters.alpha.opacity = lopac;
else if (!ie5)
document.getElementById('layerval').style.MozOpacity = lopac/100;
else document.getElementById('layer1').filters.alpha.opacity = 100;