📄 menu.js
字号:
LINK="<A href=\""+Menu[j][5]+"\""; if(mytarget!="") { LINK=LINK+" target=\""+mytarget+"\""; } LINK=LINK+" >"; } //Image Code var ImageCode=""; if(Menu[j][3]!="") { ImageCode=ImageCode+"<IMG Name='Image"+Menu[j][0]+"' SRC='"+Menu[j][3]+"' BORDER=0>"; } //Fonts if any var FONT_PROPERTIES=""; if(MyFONT!="") {FONT_PROPERTIES=" Face='"+MyFONT+"'";} if(MyFONTSIZE!="") {FONT_PROPERTIES=FONT_PROPERTIES+" size='"+MyFONTSIZE+"'";} if(MyFONTCOLOR!=""){FONT_PROPERTIES=FONT_PROPERTIES+" color='"+MyFONTCOLOR+"'";} if(FONT_PROPERTIES!="" ){FONT_PROPERTIES="<FONT "+FONT_PROPERTIES+">";} if(MyFONTSTYLE!=""){FONT_PROPERTIES="<"+MyFONTSTYLE+">"+FONT_PROPERTIES;} //Display IMAGE and TEXT if(ImageCode!="") { if(LINK!="") {document.write(LINK);} document.write(ImageCode); if(LINK!=""){document.write("</a>");} } if(Menu[j][2]!="") { if(FONT_PROPERTIES!="") {document.write(FONT_PROPERTIES);} document.write(MySTARTCHAR); if(LINK!="") {document.write(LINK);} document.write(Menu[j][2]); if(LINK!=""){document.write("</a>");} if(FONT_PROPERTIES!="") {document.write("</FONT>");} if(MyFONTSTYLE!="") {document.write("</"+MyFONTSTYLE+">");} } //close layer document.writeln(Layer_End); } } }/*********************************************************************************/////Sort in-case not ordered and check if every menu parent has a matching index/********************************************************************************/function Sorting(){ //Place all Parents before children for (i=0; i<(MaxMenuIndex-1);i++) { TheParent=Menu[i][1]; for (j=(i+1); j<MaxMenuIndex; j++) { if(Menu[j][0]==TheParent) { for(var f=0;f<6;f++) { temp=Menu[i][f]; Menu[i][f]=Menu[j][f]; Menu[j][f]=temp; } i=0; break; } } }}/******************************************///Netscape 4.X Correction /******************************************/function NS4XCorrection(){ if(document.layers) { Layer="\"<layer class='CBORDER' id='\"+IDLABEL+\"' position='absolute' visibility='\"+VISIBILITY+\"' left='\"+LEFT+\"' top='\"+TOP+\"' width='\"+WIDTH+\"' height='\"+HEIGHT+\"' bgcolor='\"+MyLayerColor+\"' z-index='\"+ZINDEX+\"'\" "; Layer_End="</layer>"; } NS_Table_Width_Corr=5; NS_Table_Heigth_Corr=5;}function NS4ImageCorrect(Index){ var NS4FIX=""; if(document.layers) { return "layers.Layer"+Menu[Index][0]+".document."; } return ""; } /******************************************///Calculates Menu Item Position /******************************************/function CalcLayerVariables(Index){ var ID= Menu[Index][0]; var Parent_ID= Menu[Index][1]; //if Main Parent if (ID==Parent_ID) { //Menu Type if(MENU_TYPE==1) { TOP=TopParent; LEFT=(Main_Parent_Count * WIDTH)+ LeftParent - (LayerBorderSize*Main_Parent_Count); } else { TOP=(Main_Parent_Count * HEIGHT)+TopParent - (LayerBorderSize*Main_Parent_Count); LEFT=LeftParent; } TOPLEFT[Index][0]=TOP; TOPLEFT[Index][1]=LEFT; IDLABEL="Layer"+Menu[i][0]; VISIBILITY="visible"; ZINDEX=100; //on top of the first 99 layers in the page! WIDTH=((+ORGWIDTH)-(+LayerBorderSize)); Main_Parent_Count++; } //Child else { //Find Parent ChildofAParent=false; var ParentIndex=0; for (var j=0;j<MaxMenuIndex;j++) { if (Menu[j][0]== Parent_ID) { //collecting Children of Parents for (var g=0;g<MaxMenuIndex;g++) { if(Parent_Children_ID[j][g]==null) { Parent_Children_ID[j][g]=IDLABEL; break; } } if(Menu[j][0]==Menu[j][1]) {ChildofAParent=true;} ParentIndex=j; break; } } //if child of a Main Parent and Menu Type is Horizental if(ChildofAParent && MENU_TYPE==1) { Parent_Child_Count[ParentIndex] = Parent_Child_Count[ParentIndex] + 1; TOP=TopParent+(Parent_Child_Count[ParentIndex] * HEIGHT) - ((Parent_Child_Count[ParentIndex])*LayerBorderSize); LEFT=TOPLEFT[ParentIndex][1]; ZINDEX=101; //on top of the first 100 layers in the page! } //if a child of a child else { Parent_Child_Count[ParentIndex] = Parent_Child_Count[ParentIndex] + 1; TOP=(TOPLEFT[ParentIndex][0])+((Parent_Child_Count[ParentIndex]-1) * HEIGHT) - ((Parent_Child_Count[ParentIndex]-1)*LayerBorderSize) + TOP_OFFSET; LEFT=(WIDTH + TOPLEFT[ParentIndex][1]) - LEFT_OFFSET - LayerBorderSize; if(ChildofAParent){ZINDEX=101;}else{ZINDEX=102;} //on top of the first 100 layers in the page,100 is Main Parent and 101 is Parent } VISIBILITY="hidden"; IDLABEL="Layer"+Menu[Index][0]; TOPLEFT[Index][0]=TOP; TOPLEFT[Index][1]=LEFT; WIDTH=((+ORGWIDTH)-(+LayerBorderSize)); } }/******************************************///Generates onMouseOver Event for same //level layers// /******************************************/function SameLevelMouseEvents(){ //1 showHide Main Parent children for(var u=0;u<MaxMenuIndex;u++) { //if Main Parent if (Menu[u][0]==Menu[u][1]) { for(var y=0;y<MaxMenuIndex;y++) { //if not the one being tested and has the same parent if(y!=u && (Menu[y][1]==Menu[u][0])) { for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];break;}} } } } } //2 show hide same Parent menu items for(var u=0;u<MaxMenuIndex;u++) { if (Menu[u][1]!=Menu[u][0]) { for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[u][0];break;}} for(var y=0;y<MaxMenuIndex;y++) { //if not the one being tested and has the same parent and bot the parent menu if(y!=u && (Menu[y][1]==Menu[u][1]) && (Menu[y][0]!=Menu[y][1]) ) { for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];break;}} } } } } //3 show hide children of non Main Parent var same=""; for(var u=0;u<MaxMenuIndex;u++) { if (Menu[u][1]!=Menu[u][0]) { for(var y=0;y<MaxMenuIndex;y++) { if ((Menu[u][0]==Menu[y][1]) && (Menu[y][0]!=Menu[y][1]) && y!=u) { for(var z=0;z<MaxMenuIndex;z++) {if(MOUSEOVEROUT[u][z]==null) {MOUSEOVEROUT[u][z]="Layer"+Menu[y][0];same=z;break;}} //Pass Parent's show hide to the children for(var z=0;z<MaxMenuIndex;z++) { if(MOUSEOVEROUT[u][z]!=null) { for(var x=0;x<MaxMenuIndex;x++) { if(MOUSEOVEROUT[y][x]==null) {MOUSEOVEROUT[y][x]=MOUSEOVEROUT[u][z];break;} } } else {break;} } } } } } }/******************************///PathColor/******************************/function PathRoad(Parent,flag){ AtStart=false; while (!AtStart) { //change both layer color and image if(flag==1) //Roll { //Layer's Image: Browser Check if(Main_Parent_LayerRollColor!="" && Menu[Parent][0]==Menu[Parent][1]) {MyLayerRollColor=Main_Parent_LayerRollColor;} else {MyLayerRollColor=LayerRollColor;} if(Menu[Parent][4]!="") { eval("document."+NS4ImageCorrect(Parent)+"images.Image"+Menu[Parent][0]+".src='"+Menu[Parent][4]+"'"); } //Layer Color: Browser Check if(document.layers) { eval("changeProp('Layer"+Menu[Parent][0]+"','','document.bgColor','"+MyLayerRollColor+"','LAYER')"); } else if(document.getElementById || document.all) { eval("changeProp('Layer"+Menu[Parent][0]+"','','style.backgroundColor','"+MyLayerRollColor+"','DIV')"); } } else //Origin Image and Color { //Layer's Image: Browser Check if(Main_Parent_LayerColor!="" && Menu[Parent][0]==Menu[Parent][1]) {MyLayerColor=Main_Parent_LayerColor;} else {MyLayerColor=LayerColor;} if(Menu[Parent][3]!="") { eval("document."+NS4ImageCorrect(Parent)+"images.Image"+Menu[Parent][0]+".src='"+Menu[Parent][3]+"'"); } //Layer Color: Browser Check if(document.layers){eval("changeProp('Layer"+Menu[Parent][0]+"','','document.bgColor','"+MyLayerColor+"','LAYER')");} else if(document.getElementById || document.all){eval("changeProp('Layer"+Menu[Parent][0]+"','','style.backgroundColor','"+MyLayerColor+"','DIV')");} } if(Menu[Parent][0] == Menu[Parent][1]) { AtStart=true; } Parent=INDEXof(Menu[Parent][1]); }}//Find the index of the Menu Array with the Parent: Parentfunction INDEXof(Parent) { for(var j=0;j<MaxMenuIndex;j++) { if(Menu[j][0]==Parent) { return (j); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -