一个简单的javascript菜单
Cell.onmouseup=function(){
Cell.className=id "_padItemHover";
menu.hideMenu();
menu.execute(ary);
}
}
else{ //按钮无效;
Cell.className=id "_padItemFalse";
Cell.onmouseover=function(){
Cell.className=id "_padItemFalseHover";
window.status=ary[4];
}
Cell.onmouseout=function(){
Cell.className=id "_padItemFalse";
window.status="";
}
}
}
else{
var hr=menu.crtElement("hr",Cell);
hr.className=id "_hr";
}
Cell.onclick=function(){
event.cancelBubble=true;
}
} 织梦好,好织梦
//菜单条的按钮
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;
}
//隐藏子菜单
this.hideMenu=function(){
if(menu.selectedIndex==-1) return;
menu.barItems[menu.selectedIndex].className=id "_barItem";

文章评论
共有位Admini5网友发表了评论 查看完整内容