<html>
<head>
<meta charset="utf-8">
<title>jQuery Treeview 插件 - 简单的树,famfamfam 主题(无线条)</title>
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/jquery.treeview.css">
<link rel="stylesheet" href="http://jquery.bassistance.de/treeview/demo/screen.css">
<script src="http://jquery.bassistance.de/treeview/lib/jquery.js" type="text/javascript"></script>
<script src="http://jquery.bassistance.de/treeview/lib/jquery.cookie.js" type="text/javascript"></script>
<script src="http://jquery.bassistance.de/treeview/jquery.treeview.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#browser").treeview({
toggle: function() {
console.log("%s was toggled.", $(this).find(">span").text());
}
});
$("#add").click(function() {
var branches = $("<li><span class='folder'>New Sublist</span><ul>" +
"<li><span class='file'>Item1</span></li>" +
"<li><span class='file'>Item2</span></li></ul></li>").appendTo("#browser");
$("#browser").treeview({
add: branches
});
});
});
</script>
</head>
<body>
<h1 id="banner">jQuery Treeview 插件 - 简单的树,famfamfam 主题(无线条)</h1>
<div id="main">
<ul id="browser" class="filetree treeview-famfamfam">
<li><span class="folder">Folder 1</span>
<ul>
<li><span class="folder">Item 1.1</span>
<ul>
<li><span class="file">Item 1.1.1</span></li>
</ul>
</li>
<li><span class="folder">Folder 2</span>
<ul>
<li><span class="folder">Subfolder 2.1</span>
<ul id="folder21">
<li><span class="file">File 2.1.1</span></li>
<li><span class="file">File 2.1.2</span></li>
</ul>
</li>
<li><span class="folder">Subfolder 2.2</span>
<ul>
<li><span class="file">File 2.2.1</span></li>
<li><span class="file">File 2.2.2</span></li>
</ul>
</li>
</ul>
</li>
<li class="closed"><span class="folder">Folder 3(开始时是关闭的)</span>
<ul>
<li><span class="file">File 3.1</span></li>
</ul>
</li>
<li><span class="file">File 4</span></li>
</ul>
</li>
</ul>
<button id="add">添加!</button>
<p>来自 <a href="http://www.famfamfam.com/lab/icons/">famfamfam</a> 的 +/- 图标</p>
</div>
</body>
</html>