ASP PHP XML AjaxJavaScript VbScript ColdFusion JSP CGI 应用服务器 其它
返回首页

一个简单的javascript菜单(4)

时间:2006-09-08来源: 作者: 点击:
//菜单条的按钮 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


  //菜单条的按钮
  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;
  }

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名:密码: 验证码:点击我更换图片
推荐内容