This code shows and hides DIVs and it works great. I am having trouble adding code that will hide all other DIVs when you show another DIV. I’m trying to use previousSibling to hide the open DIV but I’m not able to get it to work. If there is a better way please tell me. Any suggestions will be greatly appreciated.
[CODE]function showContent(vThis){
vParent = vThis.parentNode;
vSibling = vParent.nextSibling;
while (vSibling.nodeType==3) {
vSibling = vSibling.nextSibling;
};
if(vSibling.style.display == “none”){
vThis.src=”images/collapse.gif”;
vThis.alt = “hide”;
vSibling.style.display = “block”;
} else {
vSibling.style.display = “none”;
vThis.src=”images/expand.gif”;
vThis.alt = “show”;
}
return;
}