请问有没有人能给我发一个完整的静态树结构的代码! http://www.pudn.com/sourcecode/windows/GUI-Control/menu/detail84667.html?name=JS目录树.rar这里好像有!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://esbase.com/downloads/lesson/treeview/ 发个完整的代码给我吧,我对javascript不懂的,但是有急用! <html><head><title>Tree Menu</title></head><script language="javascript" type="text/javascript"><!--function tog(item){ obj=document.getElementById(item); visible=(obj.style.display!="none"); key=document.getElementById("x" + item); if (visible) { obj.style.display="none"; key.innerHTML="+"; } else { obj.style.display="block"; key.innerHTML="-"; }} function expall(item,yes){ obj=document.getElementById(item); arr=obj.getElementsByTagName("UL"); for (i=0;i<arr.length;i++) { key=document.getElementById("x" + arr[i].id); if(yes){ arr[i].style.display="block"; key.innerHTML="-"; }else{ arr[i].style.display="none"; key.innerHTML="+"; } }}//--></script><div id='tree'><a id='xall' href="javascript:tog('all');">+</a><ul id='all' style="display:none;"><li>child1</li><li ><a id='xfather' href="javascript:tog('father');">+</a>father<ul id='father' style="display:none;"><li>child2</li><li>child3</li> </ul></li></ul></div><p><a href="javascript:expall('tree',1);">Expand All</a> -- <a href="javascript:expall('tree',0);">Collapse All</a></p><p>Extended from <a href="http://www.codeproject.com/jscript/treemenu.asp">Marcelo Franco</a>'s tree menu.</p></body></html> <OBJECT id=TreeView1 style="WIDTH: 100%; HEIGHT: 100%;" classid=clsid:0713E8A2-850A-101B-AFC0-4210102A8DA7 > </OBJECT><SCRIPT LANGUAGE="javascript"> TreeView1.LineStyle=1; for(i=0;i<2;i++) {var n=TreeView1.Nodes.Add(); for(j=0;j< 2;j++) {var m= TreeView1.Nodes.Add(n,4);m.text="超级大笨蛋"; }n.text="超级大笨蛋" ;}</SCRIPT> 该如何学习javascript面向对象那块呢? 火狐中不能修改cookie的值 网页里播放avi,wmv,rm,mov等视频,请问如何用脚本控制播放,暂停,快进,快退,以及音量等,最好能有相关的资料。 100分求一个循环显示多张图片的问题 斑竹,为什么我的网站上面不能显示歌词啊? 请高手写段弹层JS效果 急~ 如何在css里写onmouseover等event? 关于highcharts绘制柱状图的问题 jqeury或js字符串截取 jquery.fileupload 插件, 成功回调函数不执行 怎么通过js在层里面加上滤镜样式 取JS文件里的数据
<head>
<title>Tree Menu</title>
</head>
<script language="javascript" type="text/javascript">
<!--
function tog(item){
obj=document.getElementById(item);
visible=(obj.style.display!="none");
key=document.getElementById("x" + item);
if (visible) {
obj.style.display="none";
key.innerHTML="+";
} else {
obj.style.display="block";
key.innerHTML="-";
}
}
function expall(item,yes){
obj=document.getElementById(item);
arr=obj.getElementsByTagName("UL");
for (i=0;i<arr.length;i++) {
key=document.getElementById("x" + arr[i].id);
if(yes){
arr[i].style.display="block";
key.innerHTML="-";
}else{
arr[i].style.display="none";
key.innerHTML="+";
}
}
}
//-->
</script><div id='tree'>
<a id='xall' href="javascript:tog('all');">+</a>
<ul id='all' style="display:none;">
<li>child1</li>
<li ><a id='xfather' href="javascript:tog('father');">+</a>father
<ul id='father' style="display:none;">
<li>child2</li>
<li>child3</li>
</ul>
</li>
</ul>
</div>
<p><a href="javascript:expall('tree',1);">Expand All</a>
-- <a href="javascript:expall('tree',0);">Collapse All</a></p>
<p>
Extended from
<a href="http://www.codeproject.com/jscript/treemenu.asp">Marcelo Franco</a>'s tree menu.
</p>
</body>
</html>
classid=clsid:0713E8A2-850A-101B-AFC0-4210102A8DA7 >
</OBJECT>
<SCRIPT LANGUAGE="javascript">
TreeView1.LineStyle=1;
for(i=0;i<2;i++)
{
var n=TreeView1.Nodes.Add();
for(j=0;j< 2;j++)
{
var m= TreeView1.Nodes.Add(n,4);
m.text="超级大笨蛋";
}
n.text="超级大笨蛋" ;
}
</SCRIPT>