»
EnglishFrenchVietnamese

Print - Submenu - JavaScriptBank.com

Full version: jsB@nk » Menu » Multilevel menu » Submenu
URL: https://www.javascriptbank.com/submenu.html

Submenu © JavaScriptBank.comThis is a simple submenu script.

Full version: jsB@nk » Menu » Multilevel menu » Submenu
URL: https://www.javascriptbank.com/submenu.html



CSS
<style>.s{font-family:verdana;font-size:12px;font-weight:bold;color:#4d4c76;cursor:default}</style><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


JavaScript
<script>//==1==Defining Colorsvar menuFrameColor='#4d4c76';var menuBgColor='#bebddf';var menuOverBgColor='#fff5c6';var menuFontColor='#4d4c76';var menuOverFontColor='#4d4c76'//(can be the same as menuFontColor)//==2==Defining TARGET for the links in the menuvar target='self'//(newWindow or self)(cannot navigate to frame)//==3==Defining font, menu cell padding & frame border widthvar font='verdana,arial,helvetica';var fontSize='10px';var fontWeight='bold';//(bold or normal)var cellPadding='2';var frameBorderWidth='1';//==4==Defining The Menus Widthvar menuWidth='140';//==5==Defining The Menus Placement (top left corner of the menus)var menuTopPixels=15;//from document top & left corner(without quotes)var menu1LeftPixels=0;var menu2LeftPixels=74;var menu3LeftPixels=144;var menu4LeftPixels=226;var menu5LeftPixels=296;//var menu6LeftPixels=400;//(if you want more add like this)//==6==Defining The Menus Count (how many do you want)var menuCount=5;//(without quotes)//=============MENU DEFINITIONS=============//(be sure to have the same number of array items for both href & text)//===Menu 1href1=new Array('http://www.epilot.com/joinnow/referral.asp?friend=hansatura','http://www.yahoo.com/','http://www.altavista.com/','http://www.search.com/','http://www.webcrawler.com/','http://www.lycos.com/','http://www.hotbot.com/');text1=new Array('ePILOT','Yahoo!','Altavista','CNET Search.com','Webcrawler','Lycos','Hotbot');function MV1(){var x='';for(i=0;i<href1.length;i++){x=x+"<tr><td class=mxz onclick=doGo('"+href1[i]+"') onmouseover=ov(this) onmouseout=ou(this)>"+text1[i]+"</td></tr>"};return x};//===Menu 1 END//===Menu 2href2=new Array('http://www.emp3mail.com/','http://mail.yahoo.com/','http://www.hotmail.com/','http://www.themail.com/','http://www.mail.com/','http://www.mail.bg/','http://www.giga.de/','http://www.xoom.com/');text2=new Array('eMP3Mail','Yahoo!','Hotmail','TheMail','Mail.com','Mail.bg','Giga.de','Xoom');function MV2(){var x='';for(i=0;i<href2.length;i++){x=x+"<tr><td class=mxz onclick=doGo('"+href2[i]+"') onmouseover=ov(this) onmouseout=ou(this)>"+text2[i]+"</td></tr>"};return x};//===Menu 2 END//===Menu 3href3=new Array('http://www.javascripts.com/','http://www.builder.com/','http://www.webreference.com/','http://msdn.microsoft.com/','http://www.livesoftware.com/','http://www.perl.com/','http://www.w3.org/');text3=new Array('JavaScripts','Builder','Webreference','MSDN','Livesoftware','Perl','WWW.org');function MV3(){var x='';for(i=0;i<href3.length;i++){x=x+"<tr><td class=mxz onclick=doGo('"+href3[i]+"') onmouseover=ov(this) onmouseout=ou(this)>"+text3[i]+"</td></tr>"};return x};//===Menu 3 END//===Menu 4href4=new Array('http://www.manutd.com/','http://www.nba.com/','http://www.chelseafc.co.uk/','http://www.fcbarcelona.com/','http://www.lufc.co.uk/','http://www.eurosport.com/','http://www.espn.com/','http://www.sportal.com/','http://www.umbro.com/');text4=new Array('Manchester United','NBA','Chelsea FC','FC Barcelona','Leeds United FC','Eurosport','ESPN','Sportal.com','UMBRO');function MV4(){var x='';for(i=0;i<href4.length;i++){x=x+"<tr><td class=mxz onclick=doGo('"+href4[i]+"') onmouseover=ov(this) onmouseout=ou(this)>"+text4[i]+"</td></tr>"};return x};//===Menu4 END//===Menu 5href5=new Array('http://www.odigo.com/','http://www.search.bg/','http://www.infowar.com/','http://www.icq//.com/','http://www.gamesforall.com/');text5=new Array('Odigo','Search.bg','Infowar','ICQ','GamesForAll');function MV5(){var x='';for(i=0;i<href5.length;i++){x=x+"<tr><td class=mxz //onclick=doGo('"+href5[i]+"') onmouseover=ov(this) onmouseout=ou(this)>"+text5[i]+"</td></tr>"};return x};//===Menu 5 END//=============MENU DEFINITIONS END=============// THE SERIOUS SCRIPT PLEASE DO NOT TOUCHif(document.all){topY=menuTopPixels}else{topY=menuTopPixels-2};/*NS bud*/function rV(){q='';for(z=1;z<=menuCount;z++){if(document.all){q=q+"m"+z+".style.display='none';"}else{q=q+"document.getElementById('m"+z+"').style.display='none';"}};return q};eval("function hide(a){if(a.clientY<=topY){"+rV()+"}};function hide2(){"+rV()+"}");eval("function ov(ok){ok.style.background='"+menuOverBgColor+"';ok.style.color='"+menuOverFontColor+"'};function ou(ok){ok.style.background='"+menuBgColor+"';ok.style.color='"+menuFontColor+"'};function doGo(ok){var tgt='"+target+"';if(tgt=='newWindow'){window.open(ok)}else{document.location.href=ok}};function show(a){if(document.all){eval(a).style.display=''}else{document.getElementById(a).style.display=''}}");document.write("<style>.mxz{font-family:"+font+";font-size:"+fontSize+";color:"+menuFontColor+";font-weight:"+fontWeight+";background:"+menuBgColor+";padding:"+cellPadding+";cursor:default}</style>");function buildTheAsses(){for(j=1;j<=menuCount;j++){document.write("<div style=position:absolute;top:"+(menuTopPixels-1)+";left:"+(eval('menu'+j+'LeftPixels')-100)+";z-index:3;display:none id="+('m'+j)+"><table cellpadding=0 cellspacing=0 border=0><tr><td colspan=3 height=1></td></tr><tr><td width=100 onmouseover=hide2()></td><td bgcolor="+menuFrameColor+"><table width="+menuWidth+" cellspacing="+frameBorderWidth+" border=0>"+eval('MV'+j+'()')+"</table></td><td width=100 onmouseover=hide2()></td></tr><tr><td colspan=3 height=200 onmouseover=hide2()></td></tr></table></div>")}};buildTheAsses()</script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<body onmouseout=hide(event)><table width=100% style=position:absolute;left:0;top:0; cellpadding=0 cellspacing=0 border=0>  <tr>     <td bgcolor=#bebddf><span class=s onmouseover=this.style.color='#fff5c6';show('m1') onmouseout=this.style.color='#4d4c76'>&nbsp;search</span><span class=s style=font-size:10px;font-weight:normal>&nbsp; &nbsp;|&nbsp; &nbsp;</span><span class=s onmouseover=this.style.color='#fff5c6';show('m2') onmouseout=this.style.color='#4d4c76'>e-mail</span><span class=s style=font-size:10px;font-weight:normal>&nbsp; &nbsp;|&nbsp; &nbsp;</span><span class=s onmouseover=this.style.color='#fff5c6';show('m3') onmouseout=this.style.color='#4d4c76'>masters</span><span class=s style=font-size:10px;font-weight:normal>&nbsp; &nbsp;|&nbsp; &nbsp;</span><span class=s onmouseover=this.style.color='#fff5c6';show('m4') onmouseout=this.style.color='#4d4c76'>sports</span><span class=s style=font-size:10px;font-weight:normal>&nbsp; &nbsp;|&nbsp; &nbsp;</span><span class=s onmouseover=this.style.color='#fff5c6';show('m5') onmouseout=this.style.color='#4d4c76'>chat/forum</span></td><!-- Only added for better visual effect of the sample -->     <td bgcolor=#bebddf align=right><a href="mailto:[email protected]?subject=Mnenie za menjutata..." title="Send me comments at [email protected]" style="font:10px verdana,arial,helvetica;font-weight:normal;text-decoration:none"><font color=#4d4c76>©2001 Vasil Dinkov&nbsp;</font></a></td>  </tr>    <tr>     <td bgcolor=#fff5c6 height=1 class=s style=font-size:1px colspan=2>x</td>  </tr>  <tr>     <td bgcolor=#4d4c76 height=1 class=s style=font-size:1px colspan=2>x</td><!--  -->  </tr></table></body><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->