This Domain(Admin5.com) is for Sale:

一个简单的javascript菜单

时间:2007-12-27  来源:不详  作者:林子
file://每个子菜单为一个table存放于menu.pad上;
menu.selectedIndex=-1; file://菜单条选中按钮的索引值
menu.board=null; file://子菜单面板 本文来自织梦

file://建立菜单条
this.crtMenuBar=function(){
var len=array.length;
menu.bar = document.body.appendChild(document.createElement('div'));
menu.bar.className=id "_bar";
for(var i=0;i<len;i ){
menu.barItems[i]=menu.addMenuBarItem(array[i][0],i);
menu.addMenuPad(array[i],i);
}
}

织梦好,好织梦

file://子菜单
this.addMenuPad=function(ary,index){
var len=ary.length;
var pad=menu.crtElement("table",menu.pad);
pad.cellSpacing=1; pad.cellPadding=0;
pad.className=id "_pad";

本文来自织梦

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;
}

dedecms.com

file://各子菜单按钮
this.addMenuPadItem=function(ary,Row){
var Cell=Row.insertCell(0);
if(ary[0]!="--"){
Cell.innerText=ary[0];
if(ary[3]){ file://有效状态;
Cell.className=id "_padItem";
Cell.onmouseover=function(){
Cell.className=id "_padItemHover";
window.status=ary[4];
}
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{ file://按钮无效;
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); dedecms.com
hr.className=id "_hr";
}
Cell.onclick=function(){
event.cancelBubble=true;
}
}

织梦内容管理系统


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

看完这篇,您有何感觉呢?

文章评论

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

24小时热门信息