I have been trying to get a layer displayed when users click on a link but haven't been able to get it working. Actually, I'm fairly new to layer use. If sombody has come code or advice it would be greatly appriciated.
function setVis(name){
var oobject
//ie 4+, may be opera, ..
if (document.all){ oobject=document.all[name].style;}
else if (NC){
oobject=document.layers[name];
}else if (document.getElementById){
{//ie5+, netscape6+, mozilla/gecko/
oobject=document.getElementById(name).style}
var v=oobject.visibility
//if it was hidden, there would be h letter first in visibility property
oobject.visibility=(v.toLowerCase().indexOf("h"==0)?(NC?"show":"visible"NC?"hide":"hidden"
}
//-->
</script>
</head>
<body>
<form>
<input type=button value="show/hide" onclick="setVis('l3')">
</form>
<div id=l3>The layer (division, if you want)</div>
</body>
</html> ~~~~~~~~~~
I do get some errors (an excepted '}' in line 36, I added another ). Also, I cannot get the layer to appear or disappear. I tried changing the visibility property of the style and in the script but to no avail. Basically, I want to have users click on an image or button and display a layer.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.