如何给文字添加事件?
打开下级菜单,现在是点“+”,能不能点文字就可以打开?怎么弄?

解决方案 »

  1.   

                    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);
      

  2.   

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