I have a piece of script which produces an "exploding menu". The menu is constructed from lists. There is a body onload command which causes all the menus to open in the collapsed position. The user clicks on a heading and the list expands.
The function that hides everything on load Gets the Element by Tag Name. In this case it is the ul. Unfortunately, I have other uls and if I use <!-- <body onload="hideall()"> all menu lists disappear. The function is:
function hideall() {
var Nodes = document.getElementsByTagName('ul')
var max = Nodes.length
for(var i = 0;i < max;i++) {
var nodeObj = Nodes.item(i)
nodeObj.style.display = 'none';
}
}
How can I get this to only collapse the lists that are held within a <div id="menu">
Help would be greatly appreciated.
Thanks,
Bob
The function that hides everything on load Gets the Element by Tag Name. In this case it is the ul. Unfortunately, I have other uls and if I use <!-- <body onload="hideall()"> all menu lists disappear. The function is:
function hideall() {
var Nodes = document.getElementsByTagName('ul')
var max = Nodes.length
for(var i = 0;i < max;i++) {
var nodeObj = Nodes.item(i)
nodeObj.style.display = 'none';
}
}
How can I get this to only collapse the lists that are held within a <div id="menu">
Help would be greatly appreciated.
Thanks,
Bob