求一个可以控制的树。 我的电脑上有一个treemaker的工具,可以方便添加树形菜单,要的话。我的msn:[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 postfix2(想做浪人):真的呀?!我上QQ不方便,发到我的Email好吗?[email protected]。 postfix2(想做浪人):可以拖放和排序吗?要类似IE的整理收藏夹的功能哦。 http://blog.csdn.net/yjgx007/archive/2004/09/13/102458.aspx目前不支持排序 资料 第一页<HEAD><TITLE> DSTree </TITLE><META NAME="Author" CONTENT="[email protected]" ><style>body,td{font:12px verdana}#treeBox{background-color:#fffffa;}#treeBox .ec{margin:0 5 0 5;}#treeBox .hasItems{font-weight:bold;height:20px;padding:3 6 0 6;margin:2px;cursor:hand;color:#555555;border:1px solid #fffffa;}#treeBox .Items{height:20px;padding:3 6 0 6;margin:1px;cursor:hand;color:#555555;border:1px solid #fffffa;}</style><base href="http://vip.5d.cn/star/dstree/" /><script>//code by star 20003-4-7var HC = "color:#990000;border:1px solid #cccccc";var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";var IO = null;function initTree(){ var rootn = document.all.menuXML.documentElement; var sd = 0; document.onselectstart = function(){return false;} document.all.treeBox.appendChild(createTree(rootn,sd));}function createTree(thisn,sd){ var nodeObj = document.createElement("span"); var upobj = document.createElement("span"); with(upobj){ style.marginLeft = sd*10; className = thisn.hasChildNodes()?"hasItems":"Items"; innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +""; onmousedown = function(){ if(event.button != 1) return; if(this.getAttribute("cn")){ this.setAttribute("open",!this.getAttribute("open")); this.cn.style.display = this.getAttribute("open")?"inline":"none"; this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif"; } if(IO){ IO.runtimeStyle.cssText = ""; IO.setAttribute("selected",false); } IO = this; this.setAttribute("selected",true); this.runtimeStyle.cssText = SC; } onmouseover = function(){ if(this.getAttribute("selected"))return; this.runtimeStyle.cssText = HC; } onmouseout = function(){ if(this.getAttribute("selected"))return; this.runtimeStyle.cssText = ""; } oncontextmenu = contextMenuHandle; onclick = clickHandle; } if(thisn.getAttribute("treeId") != null){ upobj.setAttribute("treeId",thisn.getAttribute("treeId")); } if(thisn.getAttribute("href") != null){ upobj.setAttribute("href",thisn.getAttribute("href")); } if(thisn.getAttribute("target") != null){ upobj.setAttribute("target",thisn.getAttribute("target")); } nodeObj.appendChild(upobj); nodeObj.insertAdjacentHTML("beforeEnd","<br/>") if(thisn.hasChildNodes()){ var i; var nodes = thisn.childNodes; var cn = document.createElement("span"); upobj.setAttribute("cn",cn); if(thisn.getAttribute("open") != null){ upobj.setAttribute("open",(thisn.getAttribute("open")=="true")); upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none"; if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif"; } for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1))); nodeObj.appendChild(cn); } else{ upobj.all.tags("img")[0].src ="endnode.gif"; } return nodeObj;}window.onload = initTree;</script><script>function clickHandle(){ // your code here }function contextMenuHandle(){ event.returnValue = false; var treeId = this.getAttribute("treeId"); // your code here}</script></HEAD> 第二页<BODY><xml id=menuXML><?xml version="1.0" encoding="GB2312"?><DSTreeRoot text="根节点" open="true" href="http://" treeId="123"> <DSTree text="技术论坛" open="false" treeId=""> <DSTree text="5DMedia" open="false" href="http://" target="box" treeId="12"> <DSTree text="网页编码" href="http://" target="box" treeId="4353" /> <DSTree text="手绘" href="http://" target="box" treeId="543543" /> <DSTree text="灌水" href="http://" target="box" treeId="543543" /> </DSTree> <DSTree text="BlueIdea" open="false" href="http://" target="box" treeId="213"> <DSTree text="DreamWeaver & JS" href="http://" target="box" treeId="4353" /> <DSTree text="FlashActionScript" href="http://" target="box" treeId="543543" /> </DSTree> <DSTree text="CSDN" open="false" href="http://" target="box" treeId="432"> <DSTree text="JS" href="http://" target="box" treeId="4353" /> <DSTree text="XML" href="http://" target="box" treeId="543543" /> </DSTree> </DSTree> <DSTree text="资源站点" open="false" treeId=""> <DSTree text="素材屋" href="http://" target="box" treeId="12" /> <DSTree text="桌面城市" open="false" href="http://" target="box" treeId="213"> <DSTree text="壁纸" href="http://" target="box" treeId="4353" /> <DSTree text="字体" href="http://" target="box" treeId="543543" /> </DSTree> <DSTree text="MSDN" open="false" href="http://" target="box" treeId="432"> <DSTree text="DHTML" href="http://" target="box" treeId="4353" /> <DSTree text="HTC" href="http://" target="box" treeId="543543" /> <DSTree text="XML" href="" target="box" treeId="2312" /> </DSTree> </DSTree></DSTreeRoot></xml><table style="position:absolute;left:100;top:100;"><tr><td id=treeBox style="width:400px;height:200px;border:1px solid #cccccc;padding:5 3 3 5;" valign=top></td></tr><tr><td style="font:10px verdana;color:#999999" align=right>by <font color=#660000>sTar</font><br/> 2003-4-8</td></tr></table></BODY></HTML> postfix2(想做浪人):那先谢谢!我弄个QQ去先。周一见! postfix2(想做浪人)cynthia8(桔子)ouyld(ゎたしすきぁぉた)你们给的树只是普通的树,不能实现我要的拖动和排序。所以只能给你们5分。yjgx007(谁是高手)你的树可以实现拖动,但不能实现排序,所以只能给你35分了。 自上往下滚动.请问修改那个值,可以调整它的滚动方向? fullcalendar事件如何加载? 一个删除按钮如何删除两个不同表格的行 有没有比较好的多文件批量替换字符串的工具?? 关于树 dtree <%%>操作表单元素属性问题 弹的很困惑啊 50 分求一段代码. 动态画表格. 请问大虾,在javascript中究竟能不能直接调用本地的dll,那java applet行不行呢?记记记 请问有什么办法可以从一个table中得到所有的tr和td对象吗 请问innerHTML为什么不能插入<style></style>?? FileSystemObject 需要安全提示
<TITLE> DSTree </TITLE>
<META NAME="Author" CONTENT="[email protected]" >
<style>
body,td{font:12px verdana}
#treeBox{background-color:#fffffa;}
#treeBox .ec{margin:0 5 0 5;}
#treeBox .hasItems{font-weight:bold;height:20px;padding:3 6 0 6;margin:2px;cursor:hand;color:#555555;border:1px solid #fffffa;}
#treeBox .Items{height:20px;padding:3 6 0 6;margin:1px;cursor:hand;color:#555555;border:1px solid #fffffa;}
</style>
<base href="http://vip.5d.cn/star/dstree/" />
<script>
//code by star 20003-4-7
var HC = "color:#990000;border:1px solid #cccccc";
var SC = "background-color:#efefef;border:1px solid #cccccc;color:#000000;";
var IO = null;
function initTree(){
var rootn = document.all.menuXML.documentElement;
var sd = 0;
document.onselectstart = function(){return false;}
document.all.treeBox.appendChild(createTree(rootn,sd));
}
function createTree(thisn,sd){
var nodeObj = document.createElement("span");
var upobj = document.createElement("span");
with(upobj){
style.marginLeft = sd*10;
className = thisn.hasChildNodes()?"hasItems":"Items";
innerHTML = "<img src=expand.gif class=ec>" + thisn.getAttribute("text") +"";
onmousedown = function(){
if(event.button != 1) return;
if(this.getAttribute("cn")){
this.setAttribute("open",!this.getAttribute("open"));
this.cn.style.display = this.getAttribute("open")?"inline":"none";
this.all.tags("img")[0].src = this.getAttribute("open")?"expand.gif":"contract.gif";
}
if(IO){
IO.runtimeStyle.cssText = "";
IO.setAttribute("selected",false);
}
IO = this;
this.setAttribute("selected",true);
this.runtimeStyle.cssText = SC;
}
onmouseover = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = HC;
}
onmouseout = function(){
if(this.getAttribute("selected"))return;
this.runtimeStyle.cssText = "";
}
oncontextmenu = contextMenuHandle;
onclick = clickHandle;
} if(thisn.getAttribute("treeId") != null){
upobj.setAttribute("treeId",thisn.getAttribute("treeId"));
}
if(thisn.getAttribute("href") != null){
upobj.setAttribute("href",thisn.getAttribute("href"));
}
if(thisn.getAttribute("target") != null){
upobj.setAttribute("target",thisn.getAttribute("target"));
} nodeObj.appendChild(upobj);
nodeObj.insertAdjacentHTML("beforeEnd","<br/>") if(thisn.hasChildNodes()){
var i;
var nodes = thisn.childNodes;
var cn = document.createElement("span");
upobj.setAttribute("cn",cn);
if(thisn.getAttribute("open") != null){
upobj.setAttribute("open",(thisn.getAttribute("open")=="true"));
upobj.getAttribute("cn").style.display = upobj.getAttribute("open")?"inline":"none";
if( !upobj.getAttribute("open"))upobj.all.tags("img")[0].src ="contract.gif";
}
for(i=0;i<nodes.length;cn.appendChild(createTree(nodes[i++],sd+1)));
nodeObj.appendChild(cn);
}
else{
upobj.all.tags("img")[0].src ="endnode.gif";
}
return nodeObj;
}
window.onload = initTree;
</script><script>
function clickHandle(){
// your code here
}
function contextMenuHandle(){
event.returnValue = false;
var treeId = this.getAttribute("treeId");
// your code here
}
</script>
</HEAD>
<xml id=menuXML>
<?xml version="1.0" encoding="GB2312"?>
<DSTreeRoot text="根节点" open="true" href="http://" treeId="123">
<DSTree text="技术论坛" open="false" treeId="">
<DSTree text="5DMedia" open="false" href="http://" target="box" treeId="12">
<DSTree text="网页编码" href="http://" target="box" treeId="4353" />
<DSTree text="手绘" href="http://" target="box" treeId="543543" />
<DSTree text="灌水" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="BlueIdea" open="false" href="http://" target="box" treeId="213">
<DSTree text="DreamWeaver & JS" href="http://" target="box" treeId="4353" />
<DSTree text="FlashActionScript" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="CSDN" open="false" href="http://" target="box" treeId="432">
<DSTree text="JS" href="http://" target="box" treeId="4353" />
<DSTree text="XML" href="http://" target="box" treeId="543543" />
</DSTree>
</DSTree> <DSTree text="资源站点" open="false" treeId="">
<DSTree text="素材屋" href="http://" target="box" treeId="12" />
<DSTree text="桌面城市" open="false" href="http://" target="box" treeId="213">
<DSTree text="壁纸" href="http://" target="box" treeId="4353" />
<DSTree text="字体" href="http://" target="box" treeId="543543" />
</DSTree>
<DSTree text="MSDN" open="false" href="http://" target="box" treeId="432">
<DSTree text="DHTML" href="http://" target="box" treeId="4353" />
<DSTree text="HTC" href="http://" target="box" treeId="543543" />
<DSTree text="XML" href="" target="box" treeId="2312" />
</DSTree>
</DSTree></DSTreeRoot>
</xml>
<table style="position:absolute;left:100;top:100;">
<tr><td id=treeBox style="width:400px;height:200px;border:1px solid #cccccc;padding:5 3 3 5;" valign=top></td></tr>
<tr><td style="font:10px verdana;color:#999999" align=right>by <font color=#660000>sTar</font><br/> 2003-4-8</td></tr>
</table>
</BODY>
</HTML>
cynthia8(桔子)
ouyld(ゎたしすきぁぉた)
你们给的树只是普通的树,不能实现我要的拖动和排序。所以只能给你们5分。yjgx007(谁是高手)
你的树可以实现拖动,但不能实现排序,所以只能给你35分了。