答案 0 :(得分:1)
这是在您包含dtree提供的正确javascript文件后使用的代码:
//Create the tree
d = new dTree('d');
//Add a node and keep adding the rest of the nodes until they are all in there
d.add(
1, //Unique id for the node
-1, //Parent node -- use -1 for root
'My node', //Text Label for the node
'node.html', //Url for the node
'node title', //Title for the node
'mainframe', //Target for the node when opening the url
'img/musicfolder.gif' //Icon image. Uses default if not specified
'img/musicfolderOpen.gif' //Open Icon image. Uses default if not specified
true //Whether the node is open or not (optional)
);
//write the node to the html page
document.write(d);
我建议使用更简单的javascript树,例如'Simple Tree Menu',它更容易设置。简单树菜单可以在这里找到:
http://www.generalflows.com/www/software#sys/SimpleTreeMenuView
可以在这里下载js:
http://www.generalflows.com/js/lib/jquery/jquery-simpleTreeMenu-1.0.0.js