This is a JavaScript function for menu tree. I would like to add more sub-menu in it, not only one sub-menu. What's x.all[0]
and x.all[2]
?
var head="display:''"
img1=new Image()
img1.src="fold.gif"
img2=new Image()
img2.src="open.gif"
function change(){
if(!document.all)
return
if (event.srcElement.id=="folding"){
var x=event.srcElement.parentElement
if (x.all[2].style.display=="none"){
x.all[0].src="open.gif"
x.all[2].style.display=''
alert(x.all[2].name )
}
else{
x.all[0].src="fold.gif"
x.all[2].style.display="none"
}
}
document.onclick=change