redhead
01-21-2003, 08:20 PM
hi, hopefully someone will be able to help...
ive used this script:
function menu(f){
if(f){visi="visible";}
else{visi="hidden";}
if(document.layers){
document.menu.visibility=visi;
}
if(document.all){
document.all.menu.style.visibility=visi;
}
if(document.getElementById){
document.getElementById("menu").style.visibility=visi;
}
} to hide or show menus for ages and it has never failed me... but i was trying to add something to it so it would be able to show/hide differant layers (eg: menu(1,'moose'); to show a layer cunningly named "moose") but it didnt work. here's how i amended the above script:function menu(f,which){
if(f){visi="visible";}
else{visi="hidden";}
if(document.layers){
document.which.visibility=visi;
}
if(document.all){
document.all.which.style.visibility=visi;
}
if(document.getElementById){
document.getElementById(which).style.visibility=visi;
}
}
any ideas why this doesnt work? any help would be much appreciated :thumbsup:
ive used this script:
function menu(f){
if(f){visi="visible";}
else{visi="hidden";}
if(document.layers){
document.menu.visibility=visi;
}
if(document.all){
document.all.menu.style.visibility=visi;
}
if(document.getElementById){
document.getElementById("menu").style.visibility=visi;
}
} to hide or show menus for ages and it has never failed me... but i was trying to add something to it so it would be able to show/hide differant layers (eg: menu(1,'moose'); to show a layer cunningly named "moose") but it didnt work. here's how i amended the above script:function menu(f,which){
if(f){visi="visible";}
else{visi="hidden";}
if(document.layers){
document.which.visibility=visi;
}
if(document.all){
document.all.which.style.visibility=visi;
}
if(document.getElementById){
document.getElementById(which).style.visibility=visi;
}
}
any ideas why this doesnt work? any help would be much appreciated :thumbsup: