| 网站首页 | 硬件维修 | 应用学院 | 网络组建 | 网站制作 | 菜鸟黑客 | 编程之道 | 数码大全 | 娱乐休闲 | 软件下载 | 在线视频 | 请您留言 | 技术论坛 | 
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
  • 基于Web标准的UI组件 — 菜单…

  • 简单实用的网页表格特效

  • 使用Web标准建站第10天:自适…

  • 使用Web标准建站第11天:不用…

  • IE支持的html元素的disable在…

  • Cool Web Scrollbars - 定制…

  • CSS在IE和Nascape的显示差别

  • 创建一个纯CSS的水平导航条

  • javascript 的面向对象编…

  • 用javascript获得地址栏…

  • Q
    您现在的位置: 我是IT人 >> 网站制作 >> 网页设计 >> HTML >> 文章正文
    一个简单的javascript菜单(4)           
    一个简单的javascript菜单(4)
    作者:网络 文章来源:转载 点击数: 更新时间:2006-1-4
    [ 字体:缩小 正常 放大 | 双击自动滚屏 ]
    请选择合适的字体颜色:


      //菜单条的按钮
      this.addMenuBarItem=function(ary,index){
       var item=menu.crtElement("button",menu.bar);
       item.value=ary[0];
       item.disabled=!ary;
       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;
       }
       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=""

    [1] [2] 下一页  

    文章录入:54iter    责任编辑:54iter 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    | 设为首页 | 加入收藏 | 联系站长 | 关于我们 | 友情链接 | 版权申明 |