sliding menus
Hi there
I've created this sliding menu on my page - i.e when you click on a category, the sub categories become visible below. However, when I click on another category I want the sub categories from the previous category to disappear, but they don't. Can anyone tell me how to alter my code to reflect this? Here's the bare bones of my code:
<script language="JavaScript" type="text/JavaScript">
// Quick browser check !
ie4 = (document.all) ? true : false;
function showAll(targetId, id2, id3){
if (ie4){
target = document.all(targetId);
id2 = document.all(id2);
id3 = document.all(id3);
if (target.style.display == "none"){
target.style.display = "";
} else {
target.style.display = "none";
}
if (id2.style.display == ""){
id2.style.display = "none";
}
if (id3.style.display == ""){
id3.style.display = "none";
}
}//End If
else {
document.location = "?PortfolioID=" + targetId
}
}
</script>
<img src="image_bin/arrow.gif" width="9" height="9" /> <a href="javascript:showAll('COMM')" title="Entertainment"><%=rsDiv("Division")%></a>
<img src="image_bin/arrow.gif" width="9" height="9" /> <a href="javascript:showAll('ENT')" title="Commercial"><%=rsDiv("Division")%></a>
<img src="image_bin/arrow.gif" width="9" height="9" /> <a href="javascript:showAll('EDU')" title="Commercial"><%=rsDiv("Division")%></a>
<tr id="COMM" style="display:none">
<tr id="EDU" style="display:none">
<tr id="ENT" style="display:none">
Many thanks
Adam
|