当前位置: 首页 > 图文教程 > 网页制作 > HTML/XHTML教程 > 一个简单的javascript菜单(3)

HTML/XHTML教程
W3C教程(9):W3C XPath 活动
W3C教程(10):W3C XQuery 活动
W3C教程(8):W3C XML Schema 活动
W3C教程(5):W3C XML 活动
W3C教程(7):W3C XSL 活动
W3C教程(4):W3C XHTML 活动
W3C教程(3):W3C HTML 活动
W3C教程(2):W3C 程序
W3C教程(6):W3C CSS 活动
W3C教程(1):认识W3C
XHTML CSS网站设计的优势和问题
英文:A链接标记ie下会自动补全href
如何通过W3C验证?
XHTML标签在CSS中对应的属性及用法
网页前端开发CSS相关团队协作
网页制作初学者:学用HTML的超链接A标记
UTF-8和GB2312网页编码
让访客记住网站的三段实用代码
网易博客中用到的简单网页代码
HTML教程:title属性与alt属性

HTML/XHTML教程 中的 一个简单的javascript菜单(3)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-04   浏览: 47 ::
收藏到网摘: n/a


   pad.style.display="none";
   for(var i=1;i<len;i++){
    var Row=pad.insertRow(i-1);
    menu.addMenuPadItem(ary[i],Row);
   }
   menu.pads[index]=pad;
  }

  //各子菜单按钮
  this.addMenuPadItem=function(ary,Row){
    var Cell=Row.insertCell(0);
    if(ary[0]!="--"){
     Cell.innerText=ary[0];
     if(ary){  //有效状态;
      Cell.className=id+"_padItem";
      Cell.onmouseover=function(){
       Cell.className=id+"_padItemHover";
       window.status=ary;
      }
      Cell.onmouseout=function(){
       Cell.className=id+"_padItem";
       window.status="";
      }
      Cell.onmousedown=function(){ Cell.className=id+"_padItemDown"; }
      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;
      }
      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;
    }
  }