从阿赖大虾那里抄来的,无限层次的树形菜单。www.9499.net很好的站点。感谢阿赖。
风斧 2004-10-05 05:13:30 如果需要数据库和js文件可到阿赖网站下载。如果要正确运行“我的“代码,请创建odbc数据源“mymenu”连接tree数据库。
以下为html文件。我做的紧紧是把asp改称jsp.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>阿赖目录树控件应用示例--动态加载树前台页面</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script src="alai_tree.js" language="JavaScript"></script>
</head>
<body>
<script language="JavaScript">
var images=new alai_imagelist()
images.path="images/"
images.add("folderclose","folder")
images.add("hfile","file")
images.add("face")
images.add("angry")
images.add("plus_m","expand")
images.add("plus_top","expand_top")
images.add("plus_end","expand_end")
images.add("minus_m","collapse")
images.add("minus_top","collapse_top")
images.add("minus_end","collapse_end")
images.add("branch","leaf")
images.add("branch_end","twig")
images.add("vline","line")
images.add("blank")
var tree=new alai_tree(images,0)
tree.onexpand=function(srcNode)
{
if(srcNode.first.label.innerText=="loading...")
{
//动态加载子节点的代码:
ifrLoad.location="tree_load.jsp?id="+srcNode.getKey().replace("n","");
}
return true;
}
</script>
<iframe id="ifrLoad" style="width:0;height:0" src="tree_load.jsp?id=-1"></iframe>
<hr>
<p align="center">copywrite by 赖国欣 2003/7 All right reserved</p>
<p align="center">Email: <a href="mailto:a@lai.com.cn">a@lai.com.cn</a> website:
<a href="http://www.9499.net">http://www.9499.net</a></p>
</body>
</html>