谁做过jquery的树形菜单,如jstree,treeview之类的,最好是给个详细的例子,因为我太笨。万分感谢。
首先介绍DTREE,实例如下,代码自己执行
d = new dTree('d');
d.add(0,-1,'My example tree');
d.add(1,0,'Node 1','dtree.jsp','title1','content',true);
d.add(2,0,'Node 2','dtree.jsp','title1','content');
d.add(3,1,'Node 1.1','dtree.jsp','title1','content');
d.add(4,0,'Node 3','dtree.jsp','title1','content');
d.add(5,3,'Node 1.1.1','dtree.jsp','title1','content');
d.add(6,5,'Node 1.1.1.1','dtree.jsp','title1','content');
d.add(7,0,'Node 4','dtree.jsp','title1','content');
d.add(8,1,'Node 1.2','dtree.jsp','title1','content');
d.add(9,0,'My Pictures','dtree.jsp','title1','content','','','','images/dtree/imgfolder.gif');
d.add(10,9,'The trip to Iceland','dtree.jsp','title1','content');
d.add(11,9,'Mom\'s birthday','dtree.jsp','title1','content');
d.add(12,0,'Recycle Bin','dtree.jsp','title1','content','','','images/dtree/trash.gif');
document.write(d);
Example 2
c = new dTree('c',true);
c.add(0,-1,'My example tree');
c.add(1,0,'Node 1','','title1','',true);
c.add(2,0,'Node 2','','title1','');
c.add(3,1,'Node 1.1','','title1','');
c.add(4,0,'Node 3','','title1','');
c.add(5,3,'Node 1.1.1','','title1','');
c.add(6,5,'Node 1.1.1.1','','title1','');
c.add(7,0,'Node 4','','title1','');
c.add(8,1,'Node 1.2','','title1','');
c.add(9,0,'My Pictures','','title1','','','','','images/dtree/imgfolder.gif');
c.add(10,9,'The trip to Iceland','','title1','');
c.add(11,9,'Mom\'s birthday','','title1','');
c.add(12,0,'Recycle Bin','','title1','','','','images/dtree/trash.gif');
c.isDownCheck=true;
document.write(c);