Homepage Menu DropMenu Homepage
Overview Menu DropMenu Overview F-A-Q Script Goals Known Issues Browser Check
Instructions Menu Step 1 - The Script Step 2 - The Variables Step 3 - Menu Header Step 4 - The Menus Step 5 - Style Sheet
Download Menu Download Dropmenu DropMenu PageMaker
Contact Menu Contact Privacy Statement
Partner Sites Menu WebDevTips andys onestop

Step 4 - The Menus

The actual menus are very easy to create. As with the nav bar all we have to do is create a table layout.

Let's take a look at one of the menus used here.

<!-- DROP DOWN MENU --> 
<a name="1"></a> 
<div id="menu" style="filter:revealTrans(duration=.5, transition=3);" onmouseout="killMenu('menu')" onmouseover="checkMenu();"> 
<layer name="menu" onmouseout="killMenu('menu')" onmouseover="checkMenu();"> 
<table width="150" cellspacing="0" cellpadding="0" border="0"> 
<tr> 
  <td valign="top"> 
  <A class=menulink1 href="/dropmenu/index.shtml" onclick="goSub('/dropmenu/index.shtml','menu','');return false;"> DropMenu Homepage </A> 
  </td> 
</tr> 
</table> 
</layer> 
</div> 
<!-- END DROP DOWN MENU -->

An overview

<a name="1"></a>  this is our named anchor - not essential but useful for non javascript browsers

<div id="menu" style="filter:revealTrans(duration=.5, transition=3);"> The menu table gets enclosed in a div tag with the name of your choice. Just give the menus simple easy to remember names. The style="filter:revealTrans(duration=.5, transition=3) applies the transition to the div for use in MSIE.

<layer name="menu" onmouseout="killMenu('menu')" onmouseover="checkMenu();"> 

<layer name="menu" onmouseout="killMenu('menu')" onmouseover="checkMenu();">  Required for Netscape4x I fought hard against the inclusion of layers but there was just no way round it.

href="/dropmenu/index.shtml" onclick="goSub('/dropmenu/index.shtml','menu','');return false;" this is how we build the link the link is included in the href to make the link non javascript friendly. The next bit I'll explain a bit further.

goSub('/dropmenu/index.shtml','menu','') this is the javascript function call which takes 3 parameters. goSub('URL','MENU_NAME','TARGET').

URL - this is the url the link will go to.
MENU_NAME - this is the name of the current menu - this allows us to gracefully close the menu before going to the link.
TARGET this is where we want the page to display it can take the following values

'' - empty - the selected link will appear in the current window.
'new' - this will open a new window - html equiv target="_blank"
'framename' - framename - is whatever the target frame is called when using frames e.g 'contentframe' - html equiv taget="contentframe"

When building your menus follow this pattern

<div> 
  <layer> 
    <table> 
    your menus go here 
    </table> 
  </layer 
</div>

It's not that complicated is it - hopefully very little to learn to make you menu look good.

previous - next
If you like our script, please rate it!



Valid HTML 4.01! Valid CSS!