随着网站内容的不断增加,我们需要对其进行分类整理,而随之而来的就是网站栏目的增加。
那怎么能把所有的栏目显示出来呢?
下面我为大家提供一段栏目导航代码。
var menuids=["suckertree1"] //enter id(s) of suckertree ul menus, separated by commas
function buildsubmenus(){
for (var i=0; i var ultags=document.getelementbyid(menuids[i]).getelementsbytagname("ul")
for (var t=0; t ultags[t].parentnode.getelementsbytagname("a")[0].classname="subfolderstyle"
ultags[t].parentnode.onmouseover=function(){
this.getelementsbytagname("ul")[0].style.display="block"
}
ultags[t].parentnode.onmouseout=function(){
this.getelementsbytagname("ul")[0].style.display="none"
}
}
}
}
for (var i=0; i
for (var t=0; t
ultags[t].parentnode.onmouseover=function(){
this.getelementsbytagname("ul")[0].style.display="block"
}
ultags[t].parentnode.onmouseout=function(){
this.getelementsbytagname("ul")[0].style.display="none"
}
}
}
}
if (window.addeventlistener)
window.addeventlistener("load", buildsubmenus, false)
else if (window.attachevent)
window.attachevent("onload", buildsubmenus)
window.addeventlistener("load", buildsubmenus, false)
else if (window.attachevent)
window.attachevent("onload", buildsubmenus)