关于动态生成菜单的疑问,请高手指条明路!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Template 4</title>
<script language="JavaScript" src="navcond.js"></script> //动态菜单定义的脚本
<script language="JavaScript">
var myNavBar1 = new NavBar(0);
var dhtmlMenu;
dhtmlMenu = new NavBarMenu(100, 0); //参数一为父菜单宽度 参数二为子菜单宽度
dhtmlMenu.addItem(new NavBarMenuItem("11111", "default.asp"));
myNavBar1.addMenu(dhtmlMenu);
dhtmlMenu = new NavBarMenu(100, 120); //生成一个菜单
dhtmlMenu.addItem(new NavBarMenuItem("22222", ""));
myNavBar1.addMenu(dhtmlMenu);
dhtmlMenu = new NavBarMenu(100, 150); //生成二个菜单
dhtmlMenu.addItem(new NavBarMenuItem("2222222", ""));
dhtmlMenu.addItem(new NavBarMenuItem("3333333 ", "http://"));
myNavBar1.addMenu(dhtmlMenu);
//set menu colors 颜色设置函数
myNavBar1.setColors("#555555", "#000000", "#ffffff", "#ffcbce", "#ffffff", "#000000", "#ffcbce", "#ffcbce", "#ffffff")
//一为边框色
//二为父菜单色
//三为父菜单背景色
//四为父菜单选中字色
//五为父菜单选中背景色
//六为子菜单字色
//七为子菜单背景色
//八为子菜单选中字色
//九为子菜单选中背景色
//uncomment below line to center the menu (valid values are "left", "center", and "right"
//myNavBar1.setAlign("center")
var fullWidth;
function init() {
// Get width of window, need to account for scrollbar width in Netscape.
fullWidth = getWindowWidth()
- (isMinNS4 && getWindowHeight() < getPageHeight() ? 16 : 0);
myNavBar1.resize(fullWidth);
myNavBar1.create();
myNavBar1.setzIndex(2);
}
</script>
</head>
<body onload="init()" background="back2.gif" topmargin="0" leftmargin="0"> //动态菜单函数初始化加载
.....................
------------------------------------------------------
如何使它动态加载,而且不被其它层遮盖住?如何对它的显示位置进行精确控制?
定义文件:navcond.js
http://community.csdn.net/Expert/topic/4562/4562520.xml?temp=1.591128E-02