其实这个应该不算.NET方面的东西,只是个asp+js的,而且代码的来源是COOLMENU(http://www.dhtmlcentral.com)只是自己完全研究了一下,并准备在下步的工作中,在asp.net中实现它,可能已经有了这方面好的东西了,如果有,希望大家告诉一下,谢谢先

最终效果:
动态多层菜单

核心代码
1 js包含文件
动态多层菜单function makePageCoords(win,fr){
动态多层菜单    
if(!win) win=window
动态多层菜单    
this.x=0;this.x2=(bw.ns4 || bw.ns6)?win.innerWidth-1:win.document.body.offsetWidth;
动态多层菜单    
if(!fr&&bw.ie) this.x2-=20else if(!fr&&bw.ns4) this.x2-=4else if(bw.ns6) this.x2+=1
动态多层菜单    
this.y=0;this.y2=(bw.ns4 || bw.ns6)?win.innerHeight:win.document.body.offsetHeight;
动态多层菜单    
if(bw.ns4&&!win.rows) this.x2+=5if(!fr&&bw.ie) this.y2-=4else if(bw.ns4&&fr) this.y2+=4
动态多层菜单    
this.y2orig=this.y2; this.x50=this.x2/2this.y50=this.y2/2return this;
动态多层菜单}
动态多层菜单
/*************
动态多层菜单Debugging function
动态多层菜单**************
*/
动态多层菜单
function debug(txt,ev){if(mDebugging==2) self.status=txt; else alert(txt); if(ev) eval(ev); return false}
动态多层菜单
/************
动态多层菜单Scroll function
动态多层菜单************
*/
动态多层菜单
function cm_checkScrolled(obj){
动态多层菜单    
if(bw.ns4 || bw.ns6) obj.scrolledY=obj.win.pageYOffset
动态多层菜单    
else obj.scrolledY=obj.win.document.body.scrollTop
动态多层菜单    
if(obj.scrolledY!=obj.lastScrolled){
动态多层菜单        
if(!obj.useframes){
动态多层菜单            
for(i=0;i<obj.l[0].num;i++){var sobj=obj.l[0].o[i].oBorder; sobj.moveY(sobj.y+(obj.scrolledY-obj.lastScrolled))}
动态多层菜单            
if(obj.usebar) obj.oBar.moveY(obj.oBar.y+(obj.scrolledY-obj.lastScrolled))
动态多层菜单        }
动态多层菜单        obj.lastScrolled
=obj.scrolledY; page.y=obj.scrolledY; page.y2=page.y2orig+obj.scrolledY
动态多层菜单        
if(!obj.useframes || bw.ie){ clearTimeout(obj.tim); obj.isover=0; obj.hideSubs(1,0)}
动态多层菜单    }
if((bw.ns4 || bw.ns6) && !obj.useframes) setTimeout("cm_checkScrolled("+obj.name+")",200)
动态多层菜单}
动态多层菜单
/***********************
动态多层菜单Checking if the values are % or not.
动态多层菜单**************
*/
动态多层菜单
function cm_checkp(num,w,check,istop,ds){
动态多层菜单    
if(num){ var p=istop?toppage:page
动态多层菜单        
if(num.toString().indexOf("%")!=-1){if(w || (check && this.rows)) num=(p.x2*parseFloat(num)/100)
动态多层菜单        
else num=(p.y2*parseFloat(num)/100)
动态多层菜单        }
else num=eval(num)
动态多层菜单    }
else num=0return num
动态多层菜单}
动态多层菜单
/************
动态多层菜单Making DIV objects + DIV objects code
动态多层菜单************
*/
动态多层菜单
function cm_makeObj(obj,name,level,win,nest,o){
动态多层菜单    
if(o&&(bw.ns4||bw.ns6)) this.evnt=o
动态多层菜单    
else this.evnt=bw.dom?win.document.getElementById(obj):bw.ie4?win.document.all[obj]:bw.ns4?nest?win.document[nest].document[obj]:win.document[obj]:0;
动态多层菜单    
if(!this.evnt) return debug('There seems to be an error with this layer:\nFrame: '+win+'\nLayer: '+nest + "." + obj)
动态多层菜单  
this.ref=bw.dom?document:this.evnt.document; this.css=bw.ns4?this.evnt:this.evnt.style
动态多层菜单  
this.w=this.evnt.offsetWidth||this.css.clip.width||this.ref.width||this.css.pixelWidth||0
动态多层菜单  
this.h=this.evnt.offsetHeight||this.css.clip.height||this.ref.height||this.css.pixelHeight||0
动态多层菜单    
this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;    this.ref=bw.dom || bw.ie4?win.document:bw.ns4?this.css.document:0;
动态多层菜单    
this.hideIt=cm_hideIt; this.showIt=cm_showIt; this.writeIt=cm_writeIt; this.setactive=cm_setactive; this.addEvents=cm_addEvents; 
动态多层菜单    
this.moveIt=cm_moveIt; this.clipTo=cm_clipTo; if(name) this.parent=name; this.moveY=cm_moveY; this.l=level; this.clipOut=cm_clipOut; 
动态多层菜单    
this.filterIt=cm_filterIt; this.slide=cm_slide; this.obj = obj + "Object";     eval(this.obj + "=this"); this.tim=10this.clipy=0return this
动态多层菜单}
动态多层菜单
function cm_writeIt(text){if(!this.img1){if(bw.ns4){this.ref.write(text);
动态多层菜单
this.ref.close()}else this.evnt.innerHTML=text}}; function cm_moveY(y){this.y=y; this.css.top=y}
动态多层菜单
function cm_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x;this.css.top=this.y}
动态多层菜单
function cm_showIt(){this.css.visibility="visible"this.vis=1}; function cm_hideIt(){this.css.visibility="hidden"this.vis=0}
动态多层菜单
function cm_clipOut(px,w,ystop,tim,name){
动态多层菜单    
if(!this.vis) returnif(this.clipy<ystop-px){this.clipy+=px; this.clipTo(0,w,this.clipy,0,1)
动态多层菜单        
this.tim=setTimeout(this.obj+".clipOut("+px+","+w+","+ystop+","+tim+",'"+name+"')",tim)
动态多层菜单    }
else{if(bw.ns6){this.hideIt();}; this.clipTo(0,w,ystop,0,1); if(bw.ns6){this.showIt()}}
动态多层菜单}
动态多层菜单
function cm_slide(end,px,tim,w,h){
动态多层菜单    
if(!this.vis) return;
动态多层菜单    
if(this.y<end-px){
动态多层菜单        
if(this.y>(end-px*px-px) && px>1) px-=px/5this.moveIt(this.x,this.y+px)
动态多层菜单        
this.clipTo(end-this.y,this.width,this.height,0)
动态多层菜单        
this.tim=setTimeout(this.obj+".slide("+end+","+px+","+tim+","+w+","+h+")",tim)
动态多层菜单    }
else{this.clipTo(0,this.width,this.height,0); this.moveIt(this.x,end)}
动态多层菜单}
动态多层菜单
function cm_filterIt(f){if(this.evnt.filters[0]) this.evnt.filters[0].Stop(); else this.css.filter=f; this.evnt.filters[0].Apply(); this.showIt(); this.evnt.filters[0].Play();}
动态多层菜单
function cm_setactive(on,name,frmmouse){
动态多层菜单    
if(!name) name=this.name; var tobj=this.parent.m[name]
动态多层菜单    
if(tobj.img){if(tobj.img2){if(on) this.ref.images[tobj.img].src=tobj.img2; else this.ref.images[tobj.img].src=tobj.img1}
动态多层菜单    }
else{
动态多层菜单        
if(on){var color=tobj.c2; var fcolor=tobj.c4; var re=tobj.c3}else{var color=tobj.c1; var fcolor=tobj.c3; var re=tobj.c4}
动态多层菜单        
if(color){if(bw.dom || bw.ie4) this.css.backgroundColor=color; else if(bw.ns4) if(color=="transparent") color=nullthis.css.bgColor=color}
动态多层菜单        
if(fcolor && !bw.ns4){if(bw.ie4) this.evnt.style.color=fcolor; else if(this.evnt.childNodes[0]) this.evnt.style.color=fcolor
动态多层菜单        }
else if(fcolor&&frmmouse){t=this.parent.m[name].text; t=t.replace(re,fcolor); this.writeIt(t); if(on) this.addEvents(name,this.parent.name,tobj.lnk,this.parent.useclick)}
动态多层菜单        
if(tobj.l==0&&bw.ns6){this.parent.l[0].o[tobj.num].oBorder.hideIt(); this.parent.l[0].o[tobj.num].oBorder.showIt();} //Stupid fix for netscape 6动态多层菜单.
动态多层菜单
    }
动态多层菜单}
动态多层菜单
function cm_clipTo(t,r,b,l,w){if(bw.ns4){this.css.clip.top=t;this.css.clip.right=r; this.css.clip.bottom=b;this.css.clip.left=l
动态多层菜单}
else{this.css.clip="rect("+t+","+r+","+b+","+l+")"if(w){this.css.width=r; this.css.height=b}}; this.width=r; this.height=b}
动态多层菜单
function cm_addEvents(n,name,url,useclick){
动态多层菜单    
this.evnt.onmouseover=new Function(name+".mover('"+n+"')"); 
动态多层菜单    
this.evnt.onmouseout=new Function(name+".mmout('"+n+"')")
动态多层菜单    
if(!url && useclick) ev=new Function(name+".mover('"+n+"',1)")
动态多层菜单    
else ev=new Function(name+".go('"+n+"')")
动态多层菜单    
if(bw.ns4){this.ref.captureEvents(Event.MOUSEDOWN); this.ref.onmousedown=ev}
动态多层菜单    
else this.evnt.onclick=ev
动态多层菜单}
动态多层菜单
/************
动态多层菜单Making menu object
动态多层菜单************
*/
动态多层菜单
function cm_makeMenu(name,parent,text,link,target,width,height,img1,img2,bgcoloroff,bgcoloron,textcolor,hovercolor,onclick,onmouseover,onmouseout){
动态多层菜单    
this.m[name]=new Object(); var obj=this.m[name]; obj.name=name;    obj.subs=new Array(); obj.parent=parent; var tt
动态多层菜单    obj.lnk
=(link==0||link=='')?"":link; obj.target=target
动态多层菜单    
if(parent!="" && parent){this.m[parent].subs[this.m[parent].subs.length]=name; l=this.m[parent].l+1else l=0
动态多层菜单    obj.l
=l; prop1=l<this.level.length?this.level[l]:this.level[this.level.length-1]; prop2=this.level[0]
动态多层菜单    
if(this.l.length<=l){
动态多层菜单        
this.l[l]=new Object(); this.l[l].num=0if(l==0this.l[l].names=new Array()
动态多层菜单        
this.l[l].slide=prop1["slide"]||prop2["slide"]||0;
动态多层菜单        
this.l[l].clip=prop1["clip"]||prop2["clip"]||0this.l[l].clippx=prop1["clippx"]||prop2["clippx"]||0
动态多层菜单        
this.l[l].cliptim=prop1["cliptim"]||prop2["cliptim"]||0this.l[l].filter=prop1["filter"]||prop2["filter"]||0
动态多层菜单        
this.l[l].border=prop1["border"]||prop2["border"]; this.l[l].maxnum=0
动态多层菜单        
this.l[l].bordercolor=prop1["bordercolor"]||prop2["bordercolor"];
动态多层菜单        s
=prop1["align"]||prop2["align"]; if(s=="left") s=1else if(s=="right") s=0
动态多层菜单        
else if(s=="top") s=3else if(s=="bottom") s=2this.l[l].align=s; this.aobj[l]=-1;
动态多层菜单        
this.l[l].height=prop1["height"]||prop2["height"]; this.l[l].width=prop1["width"]||prop2["width"];
动态多层菜单        
this.l[l].style=prop1["style"]||prop2["style"]; this.l[l].tc=textcolor||prop1.textcolor||prop2.textcolor; 
动态多层菜单        
this.l[l].offsetX=String(prop1["offsetX"])!="undefined"?prop1["offsetX"]:prop2["offsetX"]
动态多层菜单        
this.l[l].offsetY=String(prop1["offsetY"])!="undefined"?prop1["offsetY"]:prop2["offsetY"]
动态多层菜单    }
if(l==0this.l[l].names[this.l[l].names.length]=name
动态多层菜单    
if(parent!="" && parent){obj.num=this.m[parent].subs.length-1}else obj.num=this.l[l].num
动态多层菜单    
this.l[l].num++; prop=l<this.level.length?this.level[l]:this.level[this.level.length-1]
动态多层菜单    obj.width
=this.checkp(width?width:prop1.width?prop1.width:prop2.width,1,0,1);
动态多层菜单    obj.height
=this.checkp(height?height:prop1.height?prop1.height:prop2.height,0,0,1);
动态多层菜单    
if(parent!="" && parent){if(this.m[parent].subs.length>this.l[l].maxnum) this.l[l].maxnum=this.m[parent].subs.length 
动态多层菜单        
if(this.m[parent].totheight==0this.m[parent].totheight=this.l[l].border
动态多层菜单        
this.m[parent].totheight+=obj.height+ this.l[l].border
动态多层菜单        
if(this.m[parent].maxwidth<obj.width) this.m[parent].maxwidth=obj.width+this.l[l].border*2
动态多层菜单    }
else{this.l[l].maxnum=this.l[l].names.length; this.totwidth+=obj.width; this.totheight+=obj.height
动态多层菜单        
this.maxwidth=this.maxwidth>obj.width?this.maxwidth:obj.width; this.maxheight=this.maxheight>obj.height?this.maxwidth:obj.height
动态多层菜单    }
if(img1) text='<img src="'+img1+'" border="0" name="imgCMenu'+name+'">'
动态多层菜单    
else if(bw.ns4){text='<font size="'+(prop1.NS4fontSize||prop2.NS4fontSize)+'" face="'+(prop1.NS4font||prop2.NS4font)+'" color="'+(textcolor||this.l[l].tc)+'">'+text+'</font>'}
动态多层菜单    
if(bw.ns4&&this.useNS4links&&(l==0||!this.useframes) ||(l==0&&img1)){tt=img1&&l==0?this.useclick?this.name+".mover('"+name+"',1);":this.name+".go('"+name+"');":"";text='<a href="#" onclick="'+tt+'return false" class="clNS4">'+text+'</a>'}
动态多层菜单    
if(img1){obj.preimg1=new Image(); obj.preimg1.src=img1}; if(img2){obj.preimg2=new Image(); obj.preimg2.src=img2}
动态多层菜单    
if(img2) obj.img="imgCMenu"+name; else obj.img=0; obj.img1=img1||""; obj.img2=img2||""; obj.text=text; obj.subx=-1;
动态多层菜单    obj.c1
=bgcoloroff||prop1.bgcoloroff||prop2.bgcoloroff; obj.c2=bgcoloron||prop1.bgcoloron||prop2.bgcoloron;
动态多层菜单    obj.c3
=textcolor||this.l[l].tc; obj.c4=hovercolor||prop1.hovercolor||prop2.hovercolor;  obj.suby=-1;
动态多层菜单    obj.mclick
=onclick||""; obj.mover=onmouseover||""; obj.mout=onmouseout||"";    obj.totheight=0; obj.maxwidth=0
动态多层菜单}
动态多层菜单
/************
动态多层菜单Onmouseout
动态多层菜单************
*/
动态多层菜单
function cm_mout(name,cl){
动态多层菜单    
if(!name&&cl&&!this.isover){this.isclicked=0this.hideSubs(1,0,0,0,1);  this.aobj[0]=-1return}
动态多层菜单    
if(!name) returnvar l=this.m[name].l;
动态多层菜单    
if((this.m[name].subs.length==0||!this.loaded)||(this.useclick&&!this.isclicked)){if((this.aobj[l+1]==-1||l>=this.l.length-1)&&this.aobj[l]!=-1){this.aobj[l].setactive(0,0,1); this.aobj[l]=-1;}}
动态多层菜单    
if(this.m[name].mout!="") eval(this.m[name].mout)
动态多层菜单    
if(this.useclick){this.isover=0return}; clearTimeout(this.tim); 
动态多层菜单    
if(!(!bw.ie&&this.useframes&&l==0&&this.aobj1)){ this.isover=0this.aobj1=0this.tim=setTimeout(this.name+".hideSubs(1,0,0,0,1)",this.wait)} 
动态多层菜单}
动态多层菜单
/************
动态多层菜单Onmouseover
动态多层菜单************
*/
动态多层菜单
function cm_mover(name,cl){
动态多层菜单    clearTimeout(
this.tim); this.isover=1var l=this.m[name].l;
动态多层菜单    
if(this.aobj[l].name==name){
动态多层菜单        
if(this.aobj[l+1]!=-1 && l<this.l.length-1){
动态多层菜单            
this.aobj[l+1].setactive(0,0,1); this.aobj[l+1]=-1this.hideSubs(l+2,1); return
动态多层菜单        }
else if((!this.useclick)||(this.useclick&&this.isclicked)) return
动态多层菜单    }
if(this.m[name].mover!="") eval(this.m[name].mover)
动态多层菜单    
var num=this.m[name].num; var obj=this.l[l].o[num]
动态多层菜单    
if(this.aobj[l].name!=name){if(this.aobj[l]!=-1this.aobj[l].setactive(0,0,1); this.aobj[l]=obj; this.aobj[l].name=name; obj.setactive(1,0,1)}
动态多层菜单    
if(l==1)this.aobj1=1if(l==0 && cl && this.useclick) this.isclicked=1
动态多层菜单    
if(!this.isclicked&&this.useclick) returnif(!this.loaded) return;
动态多层菜单    
this.showSubs(name,l,num,cl)
动态多层菜单}
动态多层菜单
/************
动态多层菜单Hiding subelements
动态多层菜单************
*/
动态多层菜单
function cm_hideSubs(l,system,cl,sys2,hc){
动态多层菜单    
if(this.isover && !system) return
动态多层菜单    
if(l==1 && this.aobj[0]!=-1&&!sys2){this.aobj[0].setactive(0,0,1);this.aobj[0]=-1}
动态多层菜单    
if(!this.loaded) returnif(cl==1return
动态多层菜单    
for(i=l;i<this.l.length;i++){if(this.l[i].oBorder.vis==0breakthis.l[i].oBorder.hideIt(); this.aobj[i]=-1;}
动态多层菜单    
if(hc&&this.hcode){eval(this.hcode); this.hcode=""}
动态多层菜单}
动态多层菜单
/************
动态多层菜单Get x/y coords. Only the first time :)
动态多层菜单************
*/
动态多层菜单
function cm_getCoords(name,l,num,topalign,align,ln,border,cn,lev1b){
动态多层菜单    
if(cn==5){ this.m[name].subx=0this.m[name].suby=0return }//Just in case infinitive loops
动态多层菜单
    if(l==1var pobj=this.l[l-1].o[num].oBorder
动态多层菜单    
else var pobj=this.l[l-1].oBorder
动态多层菜单    
var x=pobj.x; var y=pobj.y;
动态多层菜单    
if(l!=1){y+=this.l[l-1].o[num].y}
动态多层菜单    pborder
=this.l[l-1].border; 
动态多层菜单    lx
=x+pobj.width; rx=x-this.m[name].maxwidth- (this.l[l-1].offsetX*2)
动态多层菜单    
if(align==0){if(l==1){y+=border} if(l==1&&this.useframes) x=0else x=lx
动态多层菜单    }
else if(align==1){x=rx; if(l==1){if(this.useframes) x=page.x2 - this.m[name].maxwidth; y+=border}}
动态多层菜单    
if((align==2||topalign==2)&&lev1b!=3){
动态多层菜单        
if(l!=1 && (align!=1&&align!=0)){if(topalign==1) x=rx; else x=lx}
动态多层菜单        
if(l==1if(this.useframes) y=0else y+=this.m[name].height+border+pborder;
动态多层菜单    }
if((align==3||topalign==3)&&lev1b!=2){
动态多层菜单        
if(l!=1&&align!=1&&align!=0){if(topalign==1) x=rx; else x=lx}
动态多层菜单        
if(this.useframes&&l==1) y=page.y2 - this.m[name].totheight - this.l[l-1].offsetY*2
动态多层菜单        
else y-=this.m[name].totheight - this.l[l].offsetY*2if(l!=1||lev1b==3) y+=this.m[name].height
动态多层菜单    }
this.m[name].scrollY=this.lastScrolled; this.m[name].subx=x+this.l[l-1].offsetX; 
动态多层菜单    
this.m[name].suby=y+this.l[l-1].offsetY; if(this.useframes&&l==1&&align!=3this.m[name].suby+=this.lastScrolled
动态多层菜单    
if(this.pagecheck&&(l!=1||!this.useframes)) this.checkPage(name,l,num,topalign,align,ln,border,cn)
动态多层菜单}
动态多层菜单
/************
动态多层菜单Checking page coords
动态多层菜单************
*/
动态多层菜单
function cm_checkPage(name,l,num,topalign,align,ln,border,cn){
动态多层菜单    cn
++
动态多层菜单    
if(this.m[name].subx+this.m[name].maxwidth>page.x2){
动态多层菜单        
if(align!=1){if(align==3&&topalign!=0) topalign=3; align=1this.getCoords(name,l,num,topalign,align,ln,border,cn)}
动态多层菜单    }
else if(this.m[name].subx<page.x){
动态多层菜单        
if(align!=0){if(align==3) topalign=3; align=0this.getCoords(name,l,num,topalign,align,ln,border,cn)}
动态多层菜单    }
else if((this.m[name].suby+this.m[name].totheight)>page.y2){
动态多层菜单        
if(l==1){topalign=3this.getCoords(name,l,num,topalign,align,ln,border,cn,3)}
动态多层菜单        
else if(align!=3){ align=3this.getCoords(name,l,num,topalign,align,ln,border,cn)}
动态多层菜单    }
else if(this.m[name].suby<page.y){
动态多层菜单        
if(l==1){topalign=2this.getCoords(name,l,num,topalign,align,ln,border,cn,2)}
动态多层菜单        
else if(align!=2){align=2this.getCoords(name,l,num,topalign,align,ln,border,cn)}
动态多层菜单    }
动态多层菜单}
动态多层菜单
/************
动态多层菜单Showing subelements
动态多层菜单************
*/
动态多层菜单
function cm_showSubs(name,l,num,cl){
动态多层菜单    l
+=1if(l>=this.l.length) return; ln=this.m[name].subs.length
动态多层菜单    
if(ln==0){this.hideSubs(l,1,0,1); return}
动态多层菜单    
else this.hideSubs(l+1,1); var border=this.l[l].border; this.aobj[l]=-1
动态多层菜单    
if(this.useframes&&(bw.ns4||bw.ns6)) cm_checkScrolled(this)
动态多层菜单    
if((this.m[name].subx==-1 || this.m[name].suby==-1|| this.m[name].scrollY!=this.lastScrolled || this.isresized){
动态多层菜单        
var topalign=this.l[0].align; var align=this.l[l-1].align; 
动态多层菜单        
this.getCoords(name,l,num,topalign,align,ln,border,0)
动态多层菜单    }
var x=this.m[name].subx; var y=this.m[name].suby;
动态多层菜单    
var bobj=this.l[l].oBorder; bobj.hideIt(); 
动态多层菜单
动态多层菜单    
if(this.l[l-1].clip&&!(this.l[l-1].filter&&bw.filter)){
动态多层菜单        clearTimeout(bobj.tim); bobj.clipy
=0; bobj.clipTo(0,this.m[name].maxwidth,0,0); bobj.moveIt(x,y); 
动态多层菜单    }
else if(this.l[l-1].slide&&!(this.l[l-1].filter&&bw.filter)){
动态多层菜单        clearTimeout(bobj.tim); bobj.clipTo(
0,this.m[name].maxwidth,this.m[name].totheight,0,1)
动态多层菜单        bobj.moveIt(x,y
-this.m[name].totheight)
动态多层菜单    }
else{
动态多层菜单        bobj.clipTo(
0,this.m[name].maxwidth,this.m[name].totheight,0,1)
动态多层菜单        bobj.moveIt(x,y); 
动态多层菜单    }
动态多层菜单    
var yy=border
动态多层菜单    
for(i=0;i<this.l[l].maxnum;i++){
动态多层菜单        
var obj=this.l[l].o[i]
动态多层菜单        
if(i<ln){
动态多层菜单            
var n=this.m[name].subs[i]; obj.aname=n; if(!bw.ns4||!this.NS4hover) obj.writeIt(this.m[n].text)
动态多层菜单            obj.addEvents(n,
this.name,this.m[n].lnk,this.useclick); var w=this.m[n].width; var h=this.m[n].height
动态多层菜单            
if(obj.y!=yy) obj.moveY(yy); yy+=h+border; if(!obj.img) obj.setactive(0,n,1); 
动态多层菜单            
if(obj.width!=w||obj.height!=h) obj.clipTo(0,w,h,0,1); obj.css.visibility="inherit"
动态多层菜单        }
else obj.hideIt()
动态多层菜单    }
if(this.l[l-1].filter&&bw.filter) bobj.filterIt(this.l[l-1].filter)
动态多层菜单    
else if(this.l[l-1].clip){bobj.showIt(); bobj.clipOut(this.l[l-1].clippx,this.m[name].maxwidth,this.m[name].totheight,this.l[l-1].cliptim,name);}
动态多层菜单    
else if(this.l[l-1].slide){bobj.showIt(); bobj.slide(y,15,30,this.m[name].maxwidth,this.m[name].totheight)}
动态多层菜单    
else bobj.showIt(); 
动态多层菜单    
if(!bw.ns4&&this.checkselect){ //CHECKING FOR SELECT BOXES
动态多层菜单
        for(i=0;i<this.sel.length;i++){
动态多层菜单            selx
=0; sely=0var selp;
动态多层菜单            
if(this.sel[i].offsetParent){selp=this.sel[i]; while(selp.offsetParent){selp=selp.offsetParent; selx+=selp.offsetLeft; sely+=selp.offsetTop;}}
动态多层菜单            selx
+=this.sel[i].offsetLeft; sely+=this.sel[i].offsetTop
动态多层菜单            selw
=this.sel[i].offsetWidth; selh=this.sel[i].offsetHeight
动态多层菜单            
if(((selx+selw)>this.m[name].subx && selx<(this.m[name].subx+this.m[name].maxwidth))
动态多层菜单            
&&((sely+selh)>this.m[name].suby && sely<(this.m[name].suby+this.m[name].totheight))){
动态多层菜单                
if(this.sel[i].style.visibility!="hidden"){this.sel[i].level=l; this.sel[i].style.visibility="hidden"this.hcode+=this.name+".sel["+i+"].style.visibility='visible';"}
动态多层菜单            }
else if(l<=this.sel[i].level) this.sel[i].style.visibility="visible"
动态多层菜单        }
动态多层菜单    }
else if(bw.ns4&&this.hideForm){eval(this.hideForm+".visibility='hide'"); this.hcode=this.hideForm+".visibility='show'"}
动态多层菜单}
动态多层菜单
/************
动态多层菜单Making all top elements
动态多层菜单************
*/
动态多层菜单
function cm_makeTop(rr){
动态多层菜单    
var m,rows,border,x,y,mpa
动态多层菜单    m
=this.menuplacement; rows=this.rows; this.pxbetween=this.checkp(this.pxbetween,0,1,1)
动态多层菜单    border
=this.l[0].border;y=this.checkp(this.fromtop,0,0,1)+border;x=this.checkp(this.fromleft,0,0,1)+border
动态多层菜单    
if(m=="bottomcenter"||m=="bottom"){
动态多层菜单        
if(m=="bottomcenter") x=toppage.x2/2-(this.totwidth+border*this.l[0].num+this.pxbetween*(this.l[0].num-1))/2
动态多层菜单        y
=toppage.y2-this.maxheight-border
动态多层菜单    }
else if(m=="right") x=toppage.x2-this.maxwidth-border*2
动态多层菜单    
else if(m=="bottom") y=toppage.y2-this.maxheight-border*2
动态多层菜单    
else if(m=="center"){if(rows==0) x=toppage.x2/2 -  (this.maxwidth+border*2)/2else x=toppage.x2/2 - (this.totwidth + border*this.l[0].num +this.pxbetween*(this.l[0].num-1))/2}
动态多层菜单    
else if(m.toString().indexOf(",")>-1) mpa=1
动态多层菜单    
if(this.usebar){ var bx,by,bww,bh,oBb
动态多层菜单        oNS
=bw.ns6?this.oNS[this.l[0].maxnum]:0
动态多层菜单        
this.oBar=new cm_makeObj('div'+this.name+'Bar',0,0,window,0,oNS)
动态多层菜单        
if(this.barx=="menu") bx=mpa&&rows?this.checkp(m[0],1,0,1)-border:x-border; else{ bx=this.checkp(this.barx,1,0,1) }
动态多层菜单        
if(this.bary=="menu") by=mpa&&!rows?this.checkp(m[0],0,0,1)-border:y-border; else by=this.checkp(this.bary,0,0,1);  this.oBar.moveIt(bx,by)
动态多层菜单        
if(this.barwidth=="menu"){bww=rows?mpa?(this.checkp(m[m.length-1],1,0,1)-bx)+this.m[this.l[0].names[this.l[0].num-1]].width+border:(this.totwidth +this.pxbetween*(this.l[0].num-1)):this.maxwidth; 
动态多层菜单        bww
+=!rows?border*2:0;}else bww=this.checkp(this.barwidth,1,0,1); 
动态多层菜单        
if(bw.ie&&rows&&this.barwidth=="100%"&&this.useframes) bww+=parseInt(self.document.body.leftMargin)*2
动态多层菜单        
if(this.barheight=="menu"){bh=!rows?mpa?(this.checkp(m[m.length-1],0,0,1)-by)+this.m[this.l[0].names[this.l[0].num-1]].height+border:(this.totheight + this.pxbetween*(this.l[0].num-1)):this.maxheight;
动态多层菜单        bh
+=rows?this.l[0].border*2:0;} else bh=this.checkp(this.barheight,0,0,1);
动态多层菜单        
this.oBar.clipTo(0,bww,bh,0,1);
动态多层菜单        
if(this.barinheritborder&&border){oBb=new cm_makeObj('div'+this.name+'Barb',0,0,window,'div'+this.name+'Bar'); 
动态多层菜单        oBb.moveIt(border,border); oBb.clipTo(
0,bww-border*2,bh-border*2,0,1); oBb=null;}
动态多层菜单    }
this.l[0].o=new Array(); if(this.usetextwidth) this.maxwidth=0
动态多层菜单    
for(j=0;j<this.l[0].maxnum;j++){
动态多层菜单        
this.l[0].o[j]=new cm_makeObj('div'+this.name+'0_'+j,this,0,window,'div'+this.name+'0_'+j+'b'); if(bw.ns6) oNS=this.oNS[j]; else oNS=0
动态多层菜单        
this.l[0].o[j].oBorder=new cm_makeObj('div'+this.name+'0_'+j+'b',0,0,window,0,oNS)
动态多层菜单        obj
=this.l[0].o[j]; w=this.m[this.l[0].names[j]].width; h=this.m[this.l[0].names[j]].height; if(this.usetextwidth==1) w+=obj.w
动态多层菜单        obj.addEvents(
this.l[0].names[j],this.name,this.m[this.l[0].names[j]].lnk,this.useclick); obj.clipTo(0,w,h,0,1)
动态多层菜单        
if(mpa){if(rows==1) x=this.checkp(m[j],0,1,1); else y=this.checkp(m[j],0,0,1)}
动态多层菜单        obj.moveIt(border,border); 
动态多层菜单        obj.setactive(
0,this.l[0].names[j])
动态多层菜单        obj.oBorder.moveIt(x
-border,y-border); obj.oBorder.clipTo(0,w+border*2,h+border*2,0,1); obj.oBorder.showIt()
动态多层菜单        
if(rows==0) y+=h+border+this.pxbetween      
动态多层菜单      
else{
动态多层菜单      x
+=w+border+this.pxbetween;
动态多层菜单      
if(this.usetextwidth) this.maxwidth+=w
动态多层菜单    }
动态多层菜单  }
if(this.usetextwidth) if(m=="center"){if(rows==0) x=toppage.x2/2 -  (this.maxwidth+border*2)/2else x=toppage.x2/2 - (this.totwidth + border*this.l[0].num +this.pxbetween*(this.l[0].num-1))/2}
动态多层菜单  
if(!rr){
动态多层菜单        
if(this.useclick) coolFMouseup+=this.name+".mmout('',1);"if(!this.useframes&&!bw.ns4) this.refresh()
动态多层菜单        
else if(!this.useframes&&bw.ns4){l=""if(onload){l=String(onload.toString()); l=l.replace("function onload(event)",""); l=l.slice(25,l.length-2)} l+=this.name+ ".refresh();"; onload=new Function(l)}
动态多层菜单        
if(this.resizecheck) setTimeout('window.onresize=new Function("'+this.name+'.resized()")',500)
动态多层菜单        
if(this.checkscroll){if(bw.ns4 || bw.ns6){if(this.checkscroll!=2&&this.useframes!=1){setTimeout("cm_checkScrolled("+this.name+")",200)}}}
动态多层菜单        
if(this.useframes&&!rr) this.checkFrame(0); else this.win=window
动态多层菜单    }
动态多层菜单}
动态多层菜单
/************
动态多层菜单Refreshing/making all sub elements
动态多层菜单************
*/
动态多层菜单
function cm_refresh(ev){
动态多层菜单    
var border,obj,oNS,oNS2
动态多层菜单    
if(this.useframes) page=new makePageCoords(this.win,this.useframes); else page=toppage
动态多层菜单    
for(i=1;i<this.l.length;i++){
动态多层菜单        
this.l[i].o=new Array();
动态多层菜单        border
=this.l[i].border; defheight=this.checkp(this.l[i].height)
动态多层菜单        
if(bw.ns4){oNS=new Layer(this.l[i].width,this.win); oNS.zIndex=(500+i);  if(this.l[i].border) oNS.bgColor=this.l[i].bordercolor;}
动态多层菜单        
else if(bw.ns6){oNS=document.createElement("DIV"); oNS.setAttribute("style",this.ns6styleb[i]); this.win.document.body.appendChild(oNS)}
动态多层菜单        
this.l[i].oBorder=new cm_makeObj('div'+this.name+i+"b",0,0,this.win,0,oNS)
动态多层菜单        
for(j=0;j<this.l[i].maxnum;j++){
动态多层菜单            
if(bw.ns4){oNS2=new Layer(this.l[i].width,oNS);}
动态多层菜单            
else if(bw.ns6){oNS2=document.createElement("DIV");    oNS2.setAttribute("style",this.ns6style[i]); oNS.appendChild(oNS2)}
动态多层菜单            
this.l[i].o[j]=new cm_makeObj('div'+this.name+i+'_'+j,this,i,this.win,0,oNS2)
动态多层菜单            obj
=this.l[i].o[j]; if(!obj.addEvents) return; obj.moveIt(border,(border+defheight)*+ border)
动态多层菜单        }    
动态多层菜单    }
this.loaded=1;
动态多层菜单    
if(this.checkscroll&&bw.ie){this.win.document.body.onscroll=new Function("cm_checkScrolled("+this.name+")"); cm_checkScrolled(this)}
动态多层菜单    
if(this.useclick){this.win.document.onmouseup=new Function(coolFMouseup); if(this.useframes) document.onmouseup=new Function(coolFMouseup); }
动态多层菜单    
if(!bw.ns4&&this.checkselect) this.sel=bw.ie4?this.win.document.all.tags("SELECT"):this.win.document.getElementsByTagName("SELECT")
动态多层菜单}
动态多层菜单
function cm_NS6_createElement(st,inn){el=document.createElement("DIV"); if(st) el.setAttribute("style",st); if(inn) el.innerHTML=inn; document.body.appendChild(el); return el}
动态多层菜单
/************
动态多层菜单Making code
动态多层菜单************
*/
动态多层菜单
function cm_construct(){
动态多层菜单    
this.level=nullvar str=""var str2=""var frstr=""var tempstr; num=bw.ie?this.l.length:1;
动态多层菜单    
for(i=0;i<num;i++){
动态多层菜单        
if(i!=0) frstr+='<div id="div'+this.name+i+'b" style="'+this.ns6styleb[i]+'" class="cl'+this.name+i+'b">\n'
动态多层菜单        
for(j=0;j<this.l[i].maxnum;j++){
动态多层菜单            tempstr
='<div id="div'+this.name+i+'_'+j+'" '; if(i!=0) tempstr+='style="'+this.ns6style[i]+'"'
动态多层菜单            
if(i==0){n=this.l[0].names[j]; txt=this.m[n].text
动态多层菜单                
if(!bw.ns6){
动态多层菜单                    str
+='<div id="div'+this.name+'0_'+j+'b" class="cl'+this.name+'b'+i+'">'
动态多层菜单                    str
+=tempstr+' class="cl'+this.name+i+'">'+txt+'</div>'; str+='</div>\n'
动态多层菜单                }
else this.oNS[j]=cm_NS6_createElement(this.ns6styleb[i],tempstr+' class="cl'+this.name+i+'">'+txt+'</div>')
动态多层菜单            }
else frstr+=tempstr+'"></div>\n'
动态多层菜单        }if(i!=0){frstr+='</div>\n'}
动态多层菜单    }if(this.usebar){
动态多层菜单        if(this.barinheritborder) str2='<div id=
"div'+this.name+'Barb"></div>'; 
动态多层菜单        if(bw.ns6) this.oNS[this.l[0].maxnum]=cm_NS6_createElement(this.ns6styleb[this.ns6styleb.length-1],str2)
动态多层菜单        else{str+='<div id=
"div'+this.name+'Bar">';str+=str2+'</div>\n'}
动态多层菜单    }if(!this.useframes&&bw.ie) str+=frstr; else this.frstr=frstr; if(!bw.ns6) document.write(str)
动态多层菜单    this.makeTop();    if(this.useframes) window.onerror=cm_check_error;
动态多层菜单}
动态多层菜单coolFrameError=0//Trapping external pages in frame error!
动态多层菜单function cm_check_error(e){e=e.toLowerCase(); if(e.indexOf(
"access")>-1||e.indexOf("permission")>-1){coolFrameError=1; return true;}else return false}
动态多层菜单/**************
动态多层菜单Make styles
动态多层菜单**************/
动态多层菜单function cm_makeStyle(){
动态多层菜单    var str=
"<style>\n"; var zindex=150;  var c,w,st,bg
动态多层菜单    this.ns6style=new Array(); this.ns6styleb=new Array()
动态多层菜单    for(i=0;i<this.l.length;i++){
动态多层菜单        if(i==0){if(bw.ns4){w=
"width:" +this.l[0].width+";"; this.l[i].style=""} else w=""; str+='.cl'+this.name+i+'{position:absolute; '+w+' background-color:transparent; color:'+this.l[i].tc+';'+this.l[i].style+'; cursor:pointer; cursor:hand; visibility:inherit; z-index:'+zindex+'}\n'}
动态多层菜单        else{st='position:absolute; '+this.l[i].style+';  cursor:pointer; cursor:hand; visibility:inherit; z-index:'+zindex; this.ns6style[i]=st}
动态多层菜单        bc=this.l[i].border?bw.ns4?'layer-background-color:'+this.l[i].bordercolor:'; background-color:'+this.l[i].bordercolor:
"";
动态多层菜单        if(!bw.ns4) bc+=
"; overflow:hidden"
动态多层菜单        tempstr='position:absolute; clip:rect(0,0,0,0); visibility:hidden; '+bc+'; z-index:'+(zindex-50)
动态多层菜单        if(i==0&&!bw.ns6) str+='.cl'+this.name+'b'+i+'{'+tempstr+'}\n'; 
动态多层菜单        else this.ns6styleb[i]=tempstr; zindex+=100
动态多层菜单    }    
动态多层菜单    if(this.usebar){
动态多层菜单    if(!this.barbackgroundimg){bg=this.barinheritborder?this.l[0].bordercolor:this.barcolor; st='z-index:80; position:absolute; background-color:'+bg+'; layer-background-color:'+bg
动态多层菜单        }else{ st='z-index:80; position:absolute;'; st+=bw.ns4?
"layer-background-image":"background-image"; st+=":url('"+this.barbackgroundimg+"');"}
动态多层菜单    if(!bw.ns6) str+='#div'+this.name+'Bar{'+st+'}\n'; else this.ns6styleb[this.ns6styleb.length]=st
动态多层菜单        if(this.barinheritborder&&!this.barbackgroundimg){str+='#div'+this.name+'Barb{z-index:85; position:absolute; background-color:'+this.barcolor+'; layer-background-color:'+this.barcolor+'}\n'}
动态多层菜单    }
动态多层菜单    if(bw.ns4) str+=
"A.clNS4{text-decoration:none; padding:"+this.NS4padding+"}\n"; document.write(str+"\n</style>\n")
动态多层菜单}
动态多层菜单/************
动态多层菜单Refreshing page if it's resized
动态多层菜单*************/
动态多层菜单function cm_resized(){
动态多层菜单    page2=new makePageCoords(window,this.useframes); 
动态多层菜单    if(page2.x2!=toppage.x2 || page2.y2!=toppage.y2){
动态多层菜单        if(!bw.ns4){
动态多层菜单            toppage=new makePageCoords(window,this.useframes); this.makeTop(1)
动态多层菜单            if(!this.useframes) page=toppage; this.isresized=1; eval(this.resizecode)
动态多层菜单        }else{this.win.location.reload(); location.reload()}
动态多层菜单    }if(!bw.ns4&&this.useframes){page=new makePageCoords(this.win,this.useframes)}
动态多层菜单}
动态多层菜单/************
动态多层菜单Going to another page
动态多层菜单*************/
动态多层菜单function cm_go(name){
动态多层菜单    obj=this.m[name]; url=obj.lnk; target=obj.target; fc=obj.mclick
动态多层菜单    if(url){
动态多层菜单        if(this.useframes&&!coolFrameError) loc=this.win.location.href; else loc=location.href
动态多层菜单        if(fc) eval(fc); url=this.checkFolder(loc.toString(),url); this.isover=0;
动态多层菜单        this.hideSubs(1,0,1); this.isclicked=0; this.aobj[0]=-1
动态多层菜单        if(String(target)==
"undefined" || target=="" || target==0 || target=="_self"){
动态多层菜单            this.win.location.href=url
动态多层菜单        }else if(target==
"_blank") window.open(url)
动态多层菜单        else if(target==
"_top" || target=="window") top.location.href=url  
动态多层菜单        else if(top[target]) top[target].location.href=url
动态多层菜单        else{fr=findFrame(target); if(fr) fr.location.href=url}
动态多层菜单    }else if(fc) eval(fc)
动态多层菜单}
动态多层菜单/************
动态多层菜单Getting folders - THANKS TO DCAGE FOR THIS FIX
动态多层菜单*************/
动态多层菜单function cm_checkFolder(tmp,url){
动态多层菜单    if(url.indexOf(
"mailto:")>-1 || url.indexOf("/")==0 || url.indexOf("http://")==0) return url
动态多层菜单
    else if(this.useframes && bw.ie || bw.ns6) return url
动态多层菜单    
var addr=''; var lvl=''; var off_cnt=0var cnt=0;
动态多层菜单    
if(tmp.indexOf('file:')>-1 || tmp.charAt(1)==':') addr=this.offlineUrl;
动态多层菜单    
else if(tmp.indexOf('http:')>-1) addr=this.onlineUrl;
动态多层菜单    
for(var i=0;i<addr.length;i++){if(addr.charAt(i)=='\/') off_cnt+=1}
动态多层菜单    
for(var i=0;i<tmp.length;i++){if(tmp.charAt(i)=='\/'){ cnt+=1if(cnt>off_cnt) lvl+='../'; }}
动态多层菜单    
return lvl + url
动态多层菜单}
动态多层菜单
/************
动态多层菜单Checkloaded for the frames version
动态多层菜单************
*/
动态多层菜单
function cm_checkLoaded(ev,ns){
动态多层菜单    coolFName
=eval(coolFName)
动态多层菜单    
var ok=0
动态多层菜单    
if(document.layers){ 
动态多层菜单        
if(ns){coolFName.refresh(); coolFName.nsload=1; ok=1; coolFrameError=0
动态多层菜单        }
else if(ev.target.name==coolFName.frame&&!coolFName.nsload){coolFName.refresh(); ok=1; coolFrameError=0; routeEvent(ev)}
动态多层菜单    }
else if(bw.ie){
动态多层菜单        
if (coolFName.win.document.readyState == "complete"){
动态多层菜单            coolFName.win.document.body.insertAdjacentHTML(
"beforeEnd",coolFName.frstr)
动态多层菜单            coolFName.win.document.body.onunload
=cm_unloaded; coolFName.refresh(); ok=1; coolFrameError=0
动态多层菜单        }
else setTimeout("cm_checkLoaded()",200)
动态多层菜单    }
else if(bw.ns6){ 
动态多层菜单        
if(coolFName.win.document){
动态多层菜单            
if(coolFName.win.document.body){coolFName.win.addEventListener("unload", cm_unloaded, true); coolFName.refresh(); ok=1; coolFrameError=0}
动态多层菜单            
else setTimeout("cm_checkLoaded()",200)
动态多层菜单        }
else setTimeout("cm_checkLoaded()",200)
动态多层菜单    }
动态多层菜单}
动态多层菜单
function cm_unloaded(ev){coolFName=eval(coolFName); if(!coolFName) returnif(document.layers && ev.target.name!=coolFName.frame) returnelse coolFName.nsload=0; coolFName.loaded=0if(!document.layers) setTimeout("cm_checkLoaded()",200)}
动态多层菜单
/************
动态多层菜单Make menu object
动态多层菜单************
*/
动态多层菜单
var coolFName=""var onload; var coolFMouseup="";
动态多层菜单
function makeCoolMenu(name){
动态多层菜单    coolFName
=name; this.name=name; this.lastScrolled=0;
动态多层菜单    
this.win=window; toppage=new makePageCoords(window,parent.frames.length);
动态多层菜单    
this.aobj=new Array(); this.m=new Array(); this.l=new Array()
动态多层菜单    
this.level=new Array(); this.resized=cm_resized;
动态多层菜单    
this.makeMenu=cm_makeMenu; this.showSubs=cm_showSubs; this.makeTop=cm_makeTop;
动态多层菜单    
this.getCoords=cm_getCoords; this.checkPage=cm_checkPage;
动态多层菜单    
this.mmout=cm_mout; this.mover=cm_mover; this.checkp=cm_checkp;
动态多层菜单    
this.hideSubs=cm_hideSubs; this.construct=cm_construct;
动态多层菜单    
this.makeStyle=cm_makeStyle; this.refresh=cm_refresh;
动态多层菜单    
this.go=cm_go; this.frstr=""this.mobj=new Array()
动态多层菜单    
this.totwidth=0this.totheight=0this.maxwidth=0this.maxheight=0
动态多层菜单    
this.tim=10this.loaded=0this.isover=falsethis.checkFrame=cm_checkFrame;
动态多层菜单    
this.checkFolder=cm_checkFolder; this.hcode=""this.oNS=new Array(); this.oNS2=new Array()
动态多层菜单    bw.filter
=(bw.ie6||bw.ver.indexOf("MSIE 5.5")>-1&& !bw.mac
动态多层菜单}
动态多层菜单
/************
动态多层菜单Find frame
动态多层菜单************
*/
动态多层菜单
function findFrame(frameName){
动态多层菜单    obj
=top; var frameObj=0;
动态多层菜单    
for(i=0;i<obj.frames.length;i++){
动态多层菜单        
if(obj.frames[i].name==frameName){frameObj=obj.frames[i]; break;}; ln=obj.frames[i].frames.length
动态多层菜单        
for(j=0;j<ln;j++){
动态多层菜单            
if(obj.frames[i].frames[j].name==frameName){frameObj=obj.frames[i].frames[j];  break}; ln2=obj.frames[i].frames[j].frames.length
动态多层菜单            
for(a=0;a<ln2;a++){
动态多层菜单                
if(obj.frames[i].frames[j].frames[a].name==frameName){frameObj=obj.frames[i].frames[j].frames[a]; break}
动态多层菜单            }
动态多层菜单        }
动态多层菜单    }
return frameObj
动态多层菜单}
动态多层菜单
/************
动态多层菜单Checking for frame
动态多层菜单************
*/
动态多层菜单
function cm_checkFrame(num){
动态多层菜单    
var fr; if(num==10){debug('Frame: '+this.frame+' doesn\'t exist - Value: '+fr + " - Could not build menus."); return}
动态多层菜单    
if(!top.frames[this.frame]) fr=findFrame(this.frame); else fr=top.frames[this.frame]
动态多层菜单    
if(!fr){num++; setTimeout(this.name+".checkFrame("+num+")",500)
动态多层菜单    }
elsethis.win=fr
动态多层菜单        
if(bw.ns4){
动态多层菜单            top.frames.captureEvents(Event.UNLOAD); top.frames.captureEvents(Event.LOAD); top.frames.onunload
=cm_unloaded;
动态多层菜单            top.frames.onload 
= cm_checkLoaded;    setTimeout("cm_checkLoaded(0,1)",1000)
动态多层菜单        }
else if((bw.ie||bw.ns6)) setTimeout("cm_checkLoaded()",200)
动态多层菜单    }
动态多层菜单}    
动态多层菜单

页面代码:(因为我只用到三层,所以也只定义了三层)
动态多层菜单function lib_bwcheck(){ 
动态多层菜单    
this.ver=navigator.appVersion; this.agent=navigator.userAgent
动态多层菜单    
this.dom=document.getElementById?1:0
动态多层菜单    
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
动态多层菜单    
this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
动态多层菜单    
this.ie4=(document.all && !this.dom)?1:0;
动态多层菜单    
this.ie=this.ie4||this.ie5||this.ie6
动态多层菜单    
this.mac=this.agent.indexOf("Mac")>-1
动态多层菜单    
this.opera5=this.agent.indexOf("Opera 5")>-1
动态多层菜单    
this.ns6=(this.dom && parseInt(this.ver) >= 5?1:0
动态多层菜单    
this.ns4=(document.layers && !this.dom)?1:0;
动态多层菜单    
this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
动态多层菜单    
return this
动态多层菜单    }
动态多层菜单    
var bw=new lib_bwcheck() 
动态多层菜单    
var mDebugging=2 
动态多层菜单    oCMenu
=new makeCoolMenu("oCMenu"
动态多层菜单    oCMenu.useframes
=0 
动态多层菜单    oCMenu.frame
="frmMain"
动态多层菜单    oCMenu.useclick
=0 
动态多层菜单    oCMenu.useNS4links
=1 
动态多层菜单    oCMenu.NS4padding
=0 
动态多层菜单    oCMenu.checkselect
=0
动态多层菜单    oCMenu.offlineUrl
="file:///C|/Inetpub/wwwroot/" 
动态多层菜单    oCMenu.onlineUrl
="http://www.dhtmlcentral.com/coolmenus/examples/withoutframes/" 
动态多层菜单    oCMenu.pagecheck
=1 
动态多层菜单    oCMenu.checkscroll
=0 
动态多层菜单    oCMenu.resizecheck
=1 
动态多层菜单    oCMenu.wait
=500 
动态多层菜单    oCMenu.usebar
=0 
动态多层菜单    oCMenu.barcolor
="Navy" 
动态多层菜单    oCMenu.barwidth
="740" 
动态多层菜单    oCMenu.barheight
="menu" 
动态多层菜单    oCMenu.barx
=0 
动态多层菜单    oCMenu.bary
=0
动态多层菜单    oCMenu.barinheritborder
=0
动态多层菜单    oCMenu.rows
=1 
动态多层菜单    oCMenu.fromleft
=40 
动态多层菜单    oCMenu.fromtop
=120 
动态多层菜单    oCMenu.pxbetween
=3 
动态多层菜单    oCMenu.menuplacement
="left"
动态多层菜单    oCMenu.level[
0]=new Array() 
动态多层菜单    oCMenu.level[
0].width=120 
动态多层菜单    oCMenu.level[
0].height=20 
动态多层菜单    oCMenu.level[
0].bgcoloroff="#01A37A" 
动态多层菜单    oCMenu.level[
0].bgcoloron="#D4302E" 
动态多层菜单    oCMenu.level[
0].textcolor="White" 
动态多层菜单    oCMenu.level[
0].hovercolor="White" 
动态多层菜单    oCMenu.level[
0].style="padding:2px;text-align:center; font-family:tahoma,arial,helvetica; font-size:11px; font-weight:bold" //The style for all level[0] (top) items. - Value: "style_settings"
动态多层菜单
    oCMenu.level[0].border=0 
动态多层菜单    oCMenu.level[
0].bordercolor="red" 
动态多层菜单    oCMenu.level[
0].offsetX=0 
动态多层菜单    oCMenu.level[
0].offsetY=-1 
动态多层菜单    oCMenu.level[
0].NS4font="tahoma,arial,helvetica"
动态多层菜单    oCMenu.level[
0].NS4fontSize="2"
动态多层菜单    oCMenu.level[
0].clip=1
动态多层菜单    oCMenu.level[
0].clippx=15 
动态多层菜单    oCMenu.level[
0].cliptim=50 
动态多层菜单    oCMenu.level[
0].filter="progid:DXImageTransform.Microsoft.Fade(duration=0.5)" 
动态多层菜单    oCMenu.level[
0].align="bottom" 
动态多层菜单    oCMenu.level[
1]=new Array() 
动态多层菜单    oCMenu.level[
1].width=oCMenu.level[0].width-2
动态多层菜单    oCMenu.level[
1].height=22
动态多层菜单    oCMenu.level[
1].style="padding:2px; font-family:tahoma, arial,helvetica; font-size:11px;"
动态多层菜单    oCMenu.level[
1].align="bottom" 
动态多层菜单    oCMenu.level[
1].offsetX=-(oCMenu.level[0].width-2)/2+20
动态多层菜单    oCMenu.level[
1].offsetY=0
动态多层菜单    oCMenu.level[
1].border=1 
动态多层菜单    oCMenu.level[
1].bordercolor="#FFFFFF"
动态多层菜单    oCMenu.level[
2]=new Array() 
动态多层菜单    oCMenu.level[
2].wi0099cc=150
动态多层菜单    oCMenu.level[
2].height=20
动态多层菜单    oCMenu.level[
2].bgcoloroff="#01A37A"
动态多层菜单    oCMenu.level[
2].bgcoloron="#D4302E"
动态多层菜单    oCMenu.level[
2].style="padding:2px; font-family:tahoma,arial,helvetica; font-size:11px;"
动态多层菜单    oCMenu.level[
2].align="bottom" 
动态多层菜单    oCMenu.level[
2].offsetX=0
动态多层菜单    oCMenu.level[
2].offsetY=0
动态多层菜单    oCMenu.level[
2].border=1 
动态多层菜单    oCMenu.level[
2].bordercolor="#FFFFFF"
动态多层菜单    oCMenu.level[
2].NS4font="tahoma,arial,helvetica"
动态多层菜单    oCMenu.level[
2].NS4fontSize="1"
动态多层菜单    oCMenu.level[
2].clip=1 
动态多层菜单    oCMenu.level[
2].clippx=20
动态多层菜单    oCMenu.level[
2].cliptim=50
动态多层菜单    
<%Set RsFirst=Server.CreateObject("Adodb.RecordSet")
动态多层菜单    SqlFirst
="Select Id,classname,classcode,PageUrl,ShowOrder,MenuWidth From [class] where Len(classcode)=3 Order by ShowOrder Asc"
动态多层菜单    RsFirst.OPen SqlFirst,Conn,
1,3
动态多层菜单    If Not RsFirst.Eof THen
动态多层菜单        Do While Not RsFirst.EOf
%>
动态多层菜单        oCMenu.makeMenu('
<%=RsFirst("ShowOrder")%>','','<a href=<%=RsFirst("PageUrl")%>><%=RsFirst("ClassName")%></a>','',740,<%=RsFirst("MenuWidth")%>)
动态多层菜单        
<%Set RsPS=Server.CreateObject("Adodb.RecordSet")
动态多层菜单        SqlPS
="Select classname,classcode From [class] where Len(classcode)=6 and left(classcode,3)='"&RsFirst("ClassCode")&"'"
动态多层菜单        RsPS.OPen SqlPS,Conn,
1,3
动态多层菜单        If Not RsPs.Eof THen
动态多层菜单        I
=0
动态多层菜单            Do While Not RsPs.Eof
动态多层菜单                    If RsFirst(
"ClassCode")="003" or RsFirst("ClassCode")="004" then
动态多层菜单                    
%>
动态多层菜单                        oCMenu.makeMenu('sub
<%=RsFirst("ShowOrder")%><%=I%>','<%=RsFirst("ShowOrder")%>','&nbsp;&nbsp;<%=RsPs("ClassName")%>','Products.asp?Cd=<%=RsPs("ClassCode")%>',0,150)        
动态多层菜单                    
<%Else%>
动态多层菜单                        oCMenu.makeMenu('sub
<%=RsFirst("ShowOrder")%><%=I%>','<%=RsFirst("ShowOrder")%>','&nbsp;&nbsp;<%=RsPs("ClassName")%>','Products.asp?Cd=<%=RsPs("ClassCode")%>')        
动态多层菜单                    
<%end If%>
动态多层菜单            
//oCMenu.makeMenu('sub<%=RsFirst("ShowOrder")%><%=I%>','<%=RsFirst("ShowOrder")%>','&nbsp;&nbsp;<%=RsPs("ClassName")%>','Products.asp?Cd=<%=RsPs("ClassCode")%>')        
动态多层菜单
            <%Set RsChild=Server.CreateObject("Adodb.RecordSet")
动态多层菜单                SqlChild
="Select classname,classcode From [class] where Len(classcode)=9 and left(classcode,6)='"&RsPs("ClassCode")&"'"
动态多层菜单                RsChild.OPen SqlChild,Conn,
1,3
动态多层菜单                If Not RsChild.Eof THen
动态多层菜单                J
=0
动态多层菜单                    Do While Not RsChild.Eof
动态多层菜单                    If RsFirst(
"ClassCode")="003" then
动态多层菜单                    
%>
动态多层菜单                        oCMenu.makeMenu('sub
<%=RsFirst("ShowOrder")%><%=I%><%=J%>','sub<%=RsFirst("ShowOrder")%><%=I%>','&nbsp;&nbsp;<%=RsChild("ClassName")%>','Products.asp?Cd=<%=RsChild("ClassCode")%>',0,180)
动态多层菜单                    
<%Else%>
动态多层菜单                        oCMenu.makeMenu('sub
<%=RsFirst("ShowOrder")%><%=I%><%=J%>','sub<%=RsFirst("ShowOrder")%><%=I%>','&nbsp;&nbsp;<%=RsChild("ClassName")%>','Products.asp?Cd=<%=RsChild("ClassCode")%>')
动态多层菜单                    
<%end If%>
动态多层菜单                
<%J=J+1
动态多层菜单                    RsChild.MoveNext
动态多层菜单                    Loop
动态多层菜单                End If
动态多层菜单            I
=I+1
动态多层菜单            RsPS.MoveNext
动态多层菜单            Loop
动态多层菜单        End If
动态多层菜单    RsFirst.MoveNext
动态多层菜单    Loop
动态多层菜单    End If
%>
动态多层菜单    oCMenu.makeStyle(); oCMenu.construct()            
动态多层菜单
</SCRIPT>
动态多层菜单
<SCRIPT>
动态多层菜单
function changeFilter(filter){
动态多层菜单    
if(!bw.filter){ alert('This feature only works on Explorer5.5 + '); return}
动态多层菜单    el
=oCMenu.l[1].oBorder
动态多层菜单    
if(el.evnt.filters[0]) el.evnt.filters[0].Stop();
动态多层菜单    el.css.filter
=filter
动态多层菜单    
动态多层菜单}
动态多层菜单
</SCRIPT>
动态多层菜单

从asp代码中也可以看到我的数据库结构了,呵呵,我留在这里,为以后使用做准备,呵呵~~~`

相关文章:

  • 2021-08-19
  • 2021-08-02
  • 2021-11-14
  • 2021-11-16
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2021-07-17
  • 2022-01-13
  • 2021-10-15
相关资源
相似解决方案