More Info


You are in: home > javascript > drop down menu tutorial >

There is a newer drop-down menu tutorial at:
http://www.aspandjavascript.co.uk/javascript/drop_down_menu_tutorial_version_2/

click here to go to the new drop down menu tutorial

Unfortunately, support can no longer be offered for this tutorial

Cross Browser Drop-down Menus

10. Cascading Submenus - Part Two

Have a look at the latest version of our drop-downs:

View cascading drop-down menu final version.

We're pretty much finished now.

Browser compatibility: NS 4.7, NS6.1, NS7.1, Mozilla 1.1, MSIE 6, Opera 6. If you test it with another browser, please let me know the results.

The changes

The first change you may notice is that we've replaced the transparent GIF with a nice little arrow to show that a submenu is available. It is now this image that the submenus align with.

The other change is that the submenus now show and hide themselves in a more sensible way, moving the cursor off a submenu header hides the corresponding submenu.

How it works

To make this work I added an array called tiers, one value for every menu or submenu. Tier 0 is the main menus, tier 1 is their submenus, tier 2 the submenus branching off tier 1 and so on.

I also added a new function: hideAllMenusTier which takes one paremeter (called tier) and hides all menus in a lower tier. This function is called whenever the mouse goes over a menu item or submenu header and rather neatly hides any submenus that shouldn't be there.


<< Part IX: Cascading submenus - Part One Part XI: JavaScript Wrapper >>

Get the code:
[Drop-down version] [Side-menu version] [Cascading version]

If you like Javascript Cascading Drop-down Menu ,
please rate it! @ ScriptSearch.com
Rate Our Program
@ HotScripts.com
Rate Our Program
@ AllTheScripts.com





 © James Austin 2002-05 Web site design by James Austin