//隐藏子菜单 this.hidemenu=function(){ if(menu.selectedindex==-1) return; menu.baritems[menu.selectedindex].classname=id+"_baritem"; menu.pads[selectedindex].style.display="none"; menu.selectedindex=-1; menu.board.style.display="none"; } //执行菜单命令; this.execute=function(ary){ if(ary[2]==null) return; if(ary[1]=="js") { eval(ary[2]); menu.hidemenu(); } else if(ary[1]==null || ary[1].tolowercase=="_self") location.href=ary[2]; else{ var x=window.open(ary[2],ary[1]); x.focus(); } } //建立子菜单的显示面板 this.crtmenuboard=function(){ document.write( "<div id='"+id+"_board' style='position:absolute;width:160px;height:10px;left:0px;top:20px;background-color:#666666;z-index:99;display:none;'>"+ "<div style='position:absolute;width:100%;height:100%;left:0px;top:0px;'>"+ "<iframe id='"+id+"_frame' name='"+id+"_frame' width='100%' height='100%' frameborder='0' scrolling='no'></iframe>"+ "</div>"+ "<div id='"+id+"_pad' style='position:absolute;width:100%;height:100%;left:0px;top:0px;'></div>"+ "</div>" ); menu.board=document.getelementbyid(id+"_board"); menu.pad=document.getelementbyid(id+"_pad"); menu.pad.classname=id+"_board"; menu.pad.onselectstart=function(){ return false;} } //增加对像的一个子元素 this.crtelement=function(el,p){ return p.appendchild(document.createelement(el)); } //安装菜单; this.setup=function(){ menu.crtmenuboard(); menu.crtmenubar(); document.attachevent("onclick",menu.hidemenu); } menu.setup(); } </script> </body> </html> |