js动态生成菜单树

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="utf-8">
<title>js生成菜单树</title>
<link href="assets/css/dpl-min.css" rel="stylesheet" type="text/css" />
<link href="assets/css/bui-min.css" rel="stylesheet" type="text/css" />
<link href="assets/css/main-min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://localhost:8080/CommonUtil/assets/js/jquery-1.6.js"></script>
<script type="text/javascript" src="http://localhost:8080/CommonUtil/assets/js/bui.js"></script>
<script type="text/javascript" src="http://localhost:8080/CommonUtil/assets/js/common/main-min.js"></script>
<script type="text/javascript" src="http://localhost:8080/CommonUtil/assets/js/config-min.js"></script>
<script type="text/javascript">
function a(){
BUI.use('common/main',function(){
var config = [ { //模块菜单
id : 'menu', //模块编号
collapsed : true, //默认左侧菜单收缩
homePage : 'code', //默认打开的主页
menu : [ { //二级菜单
text : '首页内容',
items : [ //三级菜单
{
id : 'code',
text : '首页代码',
href : 'main/code.html'
}, {
id : 'c',
text : '标签页',
href : 'test.html'
}, {
id : 'd',
text : '窗口变化',
href : 'test.html'
}, {
id : 'e',
text : '首页资源文件',
href : 'test.html'
}, {
id : 'g',
text : '其他',
href : 'test.html'
} ]
}, {
//二级菜单

}, {
//二级菜单
} ]
}, {

//模块菜单
} ];
//初始化主页菜单
new PageUtil.MainPage({
modulesConfig : config
});
});
}
</script>
</head>
<body onload="a()">
<ul id="J_NavContent" class="dl-tab-conten">
</ul>
</body>
</html>
阅读更多
换一批

没有更多推荐了,返回首页