|
<body> <script language="javascript"> var menu = agetimeMenu("agetime", [ [ ["文件",null,null,true,"打开文件"], //显示文字,方法,命令,状态,状栏显示文字 ["打开",null,null,false,"打开文件"], ["--"], ["你好","js","alert('Hello')",true,"一声问候"], ["新窗口","ABC","about:blank",true,"弹出ABC窗口"], ["空白",null,"about:blank",true,"在当前窗口显示空白页"] ], [ ["编辑",null,null,false,"打开文件"], ["撤消",null,null,true,"打开文件"], ["重做",null,null,true,"打开文件"] ], [ ["文件","js","alert('无子菜单')",true,"打开文件"] ] ] ); //方法为"js"时,命令则为javascript语句,为非"js"值时,命令则是一个URL,而打开这个URL的目标位置则是方法所指定的窗口; //["你好","js","alert('Hello'),true,"一声问候"]; //显示文字为"--"是按钮是一个分隔符;
function agetimeMenu(id,array){ var menu=this; menu.pad=null; //装载各个子菜单 menu.barItems=[]; //菜单条的各位按钮 menu.pads=[]; //每个子菜单为一个table存放于menu.pad上; menu.selectedIndex
|