//菜单条的按钮 this.addMenuBarItem=function(ary,index){ var item=menu.crtElement("button",menu.bar); item.value=ary[0]; item.disabled=!ary[3]; item.className=id+"_barItem"; item.onmouseover=function(){ if(menu.selectedIndex==-1){ item.className=id+"_barItemHover"; } else{ menu.barItems[selectedIndex].className=id+"_barItem"; item.className=id+"_barItemDown"; menu.showMenu(index); } window.status=ary[4]; } item.onmouseout=function(){ if(menu.selectedIndex==-1) item.className=id+"_barItem"; window.status=""; } item.onclick=function(){ event.cancelBubble=true; if(menu.selectedIndex==-1){ item.className=id+"_barItemDown"; menu.showMenu(index); } else{ menu.hideMenu(); item.className=id+"_barItemHover"; } menu.execute(ary); item.blur(); } return item; } //显示子菜单 this.showMenu=function(index){ if(menu.selectedIndex!=-1) menu.pads[selectedIndex].style.display="none"; menu.board.style.pixelLeft=menu.barItems[index].offsetLeft+2; //menu.board.style.pixelHeight=""; if(menu.pads[index].rows.length>0) menu.board.style.display=""; else menu.board.style.display="none"; menu.pads[index].style.display=""; menu.selectedIndex=index; } |