d = new dTree('d'); d.add(0,-1,'My example tree'); d.add(1,0,'Node 1','example01.html'); d.add(2,0,'Node 2','example01.html'); d.add(3,1,'Node 1.1','example01.html'); d.add(4,0,'Node 3','example01.html'); d.add(5,3,'Node 1.1.1','example01.html'); d.add(6,5,'Node 1.1.1.1','example01.html');
document.write(d);
dTree本身就提供了这样的功能,配置中的folderLinks选择,如果设为true,点击文字就是链接,设为false,点击就是展开或收缩。 var d = new dTree('d'); d.config.folderLinks = false; d.add(0,-1,'My example tree'); ...
d.add(0,-1,'My example tree');
d.add(1,0,'Node 1','example01.html');
d.add(2,0,'Node 2','example01.html');
d.add(3,1,'Node 1.1','example01.html');
d.add(4,0,'Node 3','example01.html');
d.add(5,3,'Node 1.1.1','example01.html');
d.add(6,5,'Node 1.1.1.1','example01.html');
document.write(d);
var d = new dTree('d');
d.config.folderLinks = false;
d.add(0,-1,'My example tree');
...