⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bmenu.js

📁 JSP 动态数据菜单
💻 JS
📖 第 1 页 / 共 2 页
字号:
<!--var menuinit=new Array(50),vers;//(don't change this)for(i=0;i<51;i++)menuinit[i]=new Array(3);//(don't change this)var bgimages_show = "images/down.gif";var bgimages_hide = "images/up.gif";var onemenu = 0; //open one menu at same time.1 is yes, 0 is no. default=1.var speedmout = 100; //menu show speed(1~100;default=50) *the large the fast, but also come with more bump.var speedmin = 100; //menu hide speed(1~100;default=50)var developversion = true; //when false block all script error if any.//setting of which menu should be showen. In this example you have 4 menu, which you can switch between "show" and "not show"//if you want to add extra one, you should follow this order: "menuinit[n][1]=;" (in [a][b], b must be '1', a is the serial number of menu)menuinit[1][1]="show";menuinit[2][1]="not show";menuinit[3][1]="not show";menuinit[4][1]="not show";menuinit[5][1]="not show";menuinit[6][1]="not show";menuinit[7][1]="not show";menuinit[8][1]="not show";menuinit[9][1]="not show";menuinit[10][1]="not show";menuinit[11][1]="not show";menuinit[12][1]="not show";menuinit[13][1]="not show";menuinit[14][1]="not show";menuinit[15][1]="not show";menuinit[16][1]="not show";menuinit[17][1]="not show";menuinit[18][1]="not show";menuinit[19][1]="not show";menuinit[20][1]="not show";menuinit[21][1]="not show";menuinit[22][1]="not show";menuinit[23][1]="not show";menuinit[24][1]="not show";menuinit[25][1]="not show";menuinit[26][1]="not show";menuinit[27][1]="not show";menuinit[28][1]="not show";menuinit[29][1]="not show";menuinit[30][1]="not show";////////////////////////!!!DO NOT CHANGE BELOW THIS LINE!!!!///////////////////////////////var da=new Date();var browser=new BrowserDetectLite();var fstrun=1;var op="";var whichContinue="";var whichOpen="";var opp=0;var opd=0;var opc=0;var sc=1;sd=1;var mnunum=0;var cacheObj,cacheMaxh,cacheObj2;//----------------------------------------------------------------------------------------function menuShow(obj,maxh,obj2){var da=new Date();if(fstrun==1){ op="show"; mountmfunc(0,0,0); obj2.background=bgimages_hide; obj.style.pixelHeight=2; obj.style.display='block'; opc=6.18*(speedmout*0.01); //step length opp=Math.round(opc); //rounded step length opd=(maxh/opp)/100; //times sc=1;sd=opd; fstrun=0; cacheObj=obj;cacheMaxh=maxh;cacheObj2=obj2;}else{ if(op!="show") return false;}  if(obj.style.pixelHeight<maxh-opp)  {           if(opd>1){//for slow speed              if(sd-sc<1){obj.filters.alpha.opacity+=1;sd+=opd;}              sc++;            }else{//for fast speed              obj.filters.alpha.opacity+=Math.ceil(1/opd);            }        obj.style.pixelHeight+=opp;    cacheObj=obj;cacheMaxh=maxh;cacheObj2=obj2;    setTimeout('menuShow(cacheObj,cacheMaxh,cacheObj2)','5');  }else{        obj.style.pixelHeight=maxh;        obj.filters.alpha.opacity=100;        fstrun=1;        op="";        sc=1;sd=1;        mountmfunc(1,1,1);        return true;  }}//----------------------------------------------------------------------------------------function menuHide(obj,maxh,obj2){da=new Date();if(fstrun==1){ op="hide"; mountmfunc(0,0,0); obj2.background=bgimages_show; opc=6.18*(speedmout*0.01); //step length opp=Math.round(opc); opd=((maxh-3)/opp)/100; sc=1;sd=opd; fstrun=0; cacheObj=obj;cacheMaxh=maxh;cacheObj2=obj2;}else{ if(op!="hide") return false;}  if(obj.style.pixelHeight-opp>1)  {        if(opd>1){              if(sd-sc<1){obj.filters.alpha.opacity-=1;sd+=opd;}              sc++;            }else{               obj.filters.alpha.opacity-=Math.ceil(1/opd)*0.38;            }            obj.style.pixelHeight-=opp;    setTimeout('menuHide(cacheObj,cacheMaxh,cacheObj2)','5');  }else{        obj.style.pixelHeight=1;        obj.style.display='none';        obj.filters.alpha.opacity=0;        fstrun=1;        op="";        sc=1;sd=1;        mountmfunc(1,1,1);        if(whichContinue && onemenu==1) whichContinue.click();        return true;  }}//----------------------------------------------------------------------------------------function menuChange(obj,maxh,obj2){  if(obj.style.pixelHeight>1)  {    menuHide(obj,maxh,obj2);    whichOpen='';  }  else    if(whichOpen)    {      whichContinue=obj2;          whichOpen.click();    }    else    {      menuShow(obj,maxh,obj2);      if(onemenu==1)whichOpen=obj2;      whichContinue='';    }}//----------------------------------------------------------------------------------------function mountmfunc(clk,mi,mo){//var=1 mount, var=0 disable var=2 do nothing//clk=mouse click function//mi=mouse over function//mo=mouse out functionif(clk==1){document.onclick=monclick;}else if(clk==0){document.onclick="return false;";}else{}if(mi==1){document.onmousemove=monmouseover;}else if(mi==0){document.onmousemove="return false;";}else{}if(mo==1){document.onmouseout=monmouseout;}else if(mo==0){document.onmouseout="return false;";}else{}for(i=1;i<mnunum;i++){eval("document.all.menuTitle"+i+".className='menu_title';");}}//----------------------------------------------------------------------------------------//[Public]var regex=new RegExp("menuTitle\d*","i");var regex1=new RegExp("[0-9]*$","i");var boo=0;//----------------------------------------------------------------------------------------function monmouseover(){if(event.srcElement.tagName!="TD" || boo==1) return false;if(regex.test(event.srcElement.id)){event.srcElement.className="menu_title2";boo=1;}}//----------------------------------------------------------------------------------------function monmouseout(){if(event.srcElement.tagName!="TD") return false;if(regex.test(event.srcElement.id)){event.srcElement.className="menu_title";boo=0;}}//----------------------------------------------------------------------------------------function monclick(){if(!browser.isIE5up || browser.isIE55) return true;if(event.srcElement.tagName=="A") return true;if(event.srcElement.tagName=="SPAN"){if(regex.test(event.srcElement.parentNode.id)){b=event.srcElement.parentNode.id.match(regex1);codex="menuChange(menu" + b + "," + eval("menuinit[" + b + "][2]") + "," + event.srcElement.parentNode.id+ ")";eval(codex);}}if(regex.test(event.srcElement.id)){b=event.srcElement.id.match(regex1);codex="menuChange(menu" + b + "," + eval("menuinit[" + b + "][2]") + "," + event.srcElement.id+ ")";eval(codex);}}//----------------------------------------------------------------------------------------function init(){if (document.readyState!="complete") return false;if(!browser.isIE5up || browser.isIE55) return false;if(!developversion)window.onerror = function(){window.onerror = blockError;return true;};var mccount=0;var showornot;reg=new RegExp("menu[0-9]{1,2}","i");reg1=new RegExp("[0-9]*$","i");for(i=0;i<document.all.length;i++){if(reg.test(document.all[i].id)){mnunum++;s=document.all[i].id.match(reg1);k=eval("document.all.menu" + s + ".children[0].offsetHeight"); //code to get the heighteval("menuinit[s][2]=k");for(n=0;n<document.all[i].childNodes.length;n++){if(document.all[i].childNodes.item(n).tagName=="SPAN"){//document.all[i].childNodes.item(n).}}eval("showornot=menuinit[s][1]");switch (showornot){case "show":if(++mccount>1 && onemenu==1)alert("You do not supposed put on 2 active menu while 'onemenu' on. Check your setting or turn 'onemenu' to '0'");if(onemenu==1)eval("whichOpen=menuTitle" + s);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -