请问有没有人能给我发一个完整的静态树结构的代码! 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> 滚动效果JS,IE8下无法首尾衔接 带关闭按钮的国庆背景图片实现? showModelessDialog 打开窗口在ie6,ie7中高度不一样怎么处理一下谢谢 纯js如何创建一个css+div+iframe 在html中加入脚本语言JavaScript,可是怎么样才能引入包呢 如何在页面中关闭左面浮动的页面?? 怎样将js中的单引号正常的输出,并且不报错呢 关于window.showModalDialog函数 请教:在网页中如何打开一个word文档,不可以直接打 大家帮帮看看呀~~~ 怎么通过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>