动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
   网页设计 → 阅读文章

 一个简单的javascript菜单(4)

作者:郁郁小蝎 来源:中国站长学院 
阅读 2272 人次 , 2006-2-15 14:46:00 


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


  
 本文Tags组网  
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:一个简单的javascript菜单(3)
· 下一篇:一个简单的javascript菜单(5)
· 状态栏特效
· 一组JavaScript绘图函数
· 驳“AJAX 的七宗罪”
· CSS语法手册(二)文本属性
· 精通 CSS 滤镜(一)


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077