<div id="Layer1"></div>
<div id="Layer2"></div>
<script>
var opa = 100;
function changeopa(id){
if(opa >= 0){
var mozopa = opa / 100;
document.getElementById(id).style.filter = 'alpha(opacity='+opa+')';
document.getElementById(id).style.MozOpacity = mozopa;
document.getElementById(id).style.opacity = mozopa;
opa -=5;
setTimeout("changeopa(id)", "25");
}
}
changeopa('Layer1');
</script>
It doesnt work, firefox and ie both claim that the variable id is undefined, HOWEVER when i change this
changeopa('Layer1');
to this
var id = 'Layer1'; changeopa(id);
it DOES work, wth???
please help... or suffer the consequences ;P
