// JavaScript Document
var DHTML = (document.getElementById || document.all || document.layers);
function getObj(name)
{
if (document.getElementById)
{
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all)
{
this.obj = document.allїname];
this.style = document.allїname].style;
}
else if (document.layers)
{
this.obj = document.layersїname];
this.style = document.layersїname];
}
}
function invi(name)
{
if (!DHTML) return;
var x = new getObj(name);
if(x.style.visibility == 'hidden')
{
x.style.visibility = 'visible';
}
else
{
x.style.visibility = 'hidden';
}
}
this is the code i use to make a dropdown layer visible or hidden.
i have three layers to add, to edit or to delete sometihng (imagin google's interface it's kind a like it) but this doesn'T work properly. I always have to click 2 times to get it work.
and one more question how can I make it collapse. I mean if i click add it expands add layer and collapses other 2 (edit and delete) layers?
As for having to click twice, I'm not sure without seeing it in action.
As for collpasing other layers: running over all the names of the "layers" flipping their visibilities based on the one asked for is how I always do it.