<html>
<head>
<link rel="StyleSheet" href="dtree.css" type="text/css" />
<script type="text/javascript" src="dtree.js"></script>
<script type="text/javascript">
function test(){
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");
d.add(7,0,"Node 4","example01.html");
d.add(8,1,"Node 1.2","example01.html");
d.add(9,0,"My Pictures","example01.html","Pictures I\"ve taken over the years","","","img/imgfolder.gif");
d.add(10,9,"The trip to Iceland","example01.html","Pictures of Gullfoss and Geysir");
d.add(11,9,"Mom\"s birthday","example01.html");
d.add(12,0,"Recycle Bin","example01.html","","","img/trash.gif");
document.write(d);
}
</script>
</head>
<body>
<input type="button" value="test" onclick="test()"/>
</body>
</html>
分享到:
相关推荐
**Dtree JS脚本DEMO** 是一个基于JavaScript实现的树形菜单库,它提供了简单易用的功能,便于开发者在Web应用中构建层次结构清晰的菜单系统。在给定的压缩包文件中,包含了以下几个关键组件: 1. **dtree.css**: 这...
`example01.html`是一个基础示例,它展示了如何在实际项目中应用dTree.js。通过查看这个例子,你可以学习到如何在HTML中引入dTree.js和dtree.css,如何创建树的数据结构,以及如何调用API来构建和操作树。例如,它...
4. **示例代码**:`example01.html`是一个基础示例,展示了如何初始化和使用`dtree`。它可能包含了如何定义目录数据、如何调用API以及如何与用户交互的代码。 5. **样式支持**:`dtree.css`包含了`dtree`的默认样式...
本实例Demo实现IFrame框架结构的左右上下收缩,左侧采用了DTree树结构菜单。 --------------------------------------------- This is top! --------------------------------------------- Example ............|...
3. `example.html`或`demo.html`:示例代码,展示了如何在HTML页面中引入并使用JS Tree。 4. `data.json`或`tree_data.js`:可能包含了树形数据的示例,通常以JSON格式提供。 5. `readme.md`或`README.txt`:使用...
8. `treeDemo`:可能是一个包含更多示例或测试用例的目录。 总结来说,这个项目提供了一种使用Eclipse和js tree库动态从数据库生成树形菜单的方法。开发者可以参考此项目来学习如何将数据库数据与前端交互式UI相...