JS折叠菜单点击可折叠展开(兼容IE+FF)styletype=text/css.mainDiv{width:160px;}.topItem{width:160px;height:22px;cursor:pointer;background:#467BF2;text-decoration:none;color:white;font-weight:bold;font-family:GOTHIC;}.dropMenu{background:#D9D9D9;border-top:1pxsolid#467BF2;border-left:1pxsolid#92B1F8;border-right:1pxsolid#92B1F8;border-bottom:1pxsolid#92B1F8;}.subMenu{display:none;}.subItem{padding-left:5px;cursor:pointer;font-weight:bold;text-decoration:none;color:black;}.subItema{text-decoration:none;color:black;}.subItemOver{cursor:pointer;color:blue;text-decoration:underline;font-weight:bold;padding-left:5px;}.subItemOvera{color:blue;}.drop{border-left:1pxsolidblack;border-right:1pxsolidblack;}/stylescriptlanguage=javascriptvarTIMER_SLIDE=null;varOBJ_SLIDE;varOBJ_VIEW;varPIX_SLIDE=10;//thisistheamountofslide/DELAY_SLIDEvarNEW_PIX_VAL;varDELAY_SLIDE=30;//thisisthetimebetweeneachcalltoslidevarDIV_HEIGHT=22;//valueirrelevantvarSUB_MENU_NUM=0;varRE_INIT_OBJ=null;varbMenu=document.getElementById(curMenu);varMainDiv,SubDiv//DDaddedcodedocument.write('divid=tempcontainerclass=mainDivstyle=visibility:hidden;position:absolute/div')functionInit(objDiv){if(TIMER_SLIDE==null){SUB_MENU_NUM=0;MainDiv=objDiv.parentNode;SubDiv=MainDiv.getElementsByTagName(DIV).item(0);SubDiv.onclick=SetSlide;OBJ_SLIDE=MainDiv.getElementsByTagName(DIV).item(1)OBJ_VIEW=OBJ_SLIDE.getElementsByTagName(DIV).item(0);document.getElementById(tempcontainer).innerHTML=MainDiv.getElementsByTagName(DIV).item(2).innerHTML//DDaddedcodeDIV_HEIGHT=document.getElementById(tempcontainer).offsetHeight//DDaddedcodefor(i=0;iOBJ_VIEW.childNodes.length;i++){if(OBJ_VIEW.childNodes.item(i).tagName==SPAN){SUB_MENU_NUM++;OBJ_VIEW.childNodes.item(i).onmouseover=ChangeStyle;OBJ_VIEW.childNodes.item(i).onmouseout=ChangeStyle;}}NEW_PIX_VAL=parseInt(MainDiv.getAttribute(state));}}functionSetSlide(){if(window.TIMER_SLIDE)clearInterval(TIMER_SLIDE)//DDaddedcodeif(TIMER_SLIDE==null&&this.parentNode==MainDiv)TIMER_SLIDE=setInterval('RunSlide()',DELAY_SLIDE);else{RE_INIT_OBJ=this;setTimeout('ReInit()',200);}}functionReInit(obj){Init(RE_INIT_OBJ);TIMER_SLIDE=setInterval('RunSlide()',DELAY_SLIDE);RE_INIT_OBJ=null;}functionRunSlide(){if(OBJ_VIEW.getAttribute(state)==0){NEW_PIX_VAL+=PIX_SLIDE;OBJ_SLIDE.style.height=NEW_PIX_VAL;if(NEW_PIX_VAL=DIV_HEIGHT)//DDmodifiedcode{clearInterval(TIMER_SLIDE);TIMER_SLIDE=null;OBJ_VIEW.style.display='inline';OBJ_VIEW.setAttribute(state,1)MainDiv.setAttribute(state,NEW_PIX_VAL);}}else{OBJ_VIEW.style.display='none';NEW_PIX_VAL-=PIX_SLIDE;if(NEW_PIX_VAL0)OBJ_SLIDE.style.height=NEW_PIX_VAL;if(NEW_PIX_VAL=0){NEW_PIX_VAL=0;OBJ_SLIDE.style.height=NEW_PIX_VALclearInterval(TIMER_SLIDE);TIMER_SLIDE=null;OBJ_VIEW.setAttribute(state,0)MainDiv.setAttribute(state,NEW_PIX_VAL);}}}functionChangeStyle(){if(this.className==this.getAttribute(classOut))this.className=this.getAttribute(classOver);elsethis.className=this.getAttribute(classOut);}/script!--------StartMenu----------divclass=mainDivstate=0divclass=topItemclassOut=topItemclassOver=topItemOveronMouseOver=Init(this);网页特效/divdivclass=dropMenudivclass=subMenustate=0spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#图形图像/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#鼠标事件/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#时间日期/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#导航菜单/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#文字效果/a/span/div/div/div!--------EndMenu----------BR/!--------StartMenu----------divclass=mainDivstate=0divclass=topItemclassOut=topItemclassOver=topItemOveronMouseOver=Init(this)网页教学/divdivclass=dropMenudivclass=subMenustate=0spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#网页制作/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#网络编程/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#图形图像/a/span/div/div/div!--------EndMenu----------BR/!--------StartMenu----------divclass=mainDivstate=0divclass=topItemclassOut=topItemclassOver=topItemOveronMouseOver=Init(this)网络开发/divdivclass=dropMenudivclass=subMenustate=0spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#网页设计/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#艺术创作/a/spanBR/spanclass=subItemclassOut=subItemclassOver=subItemOverahref=#电脑网络/a/span/div/div/div!--------EndMenu----------