JavaScript Code for





By Vic Phillips    http://www.VicsJavaScripts.org.uk

Based on my MakeMenu Script this cascade menu collapes when anther topic is selected.

The menu is defined in HTML code and the menu 'Style' definitions
modified by javascript customising variables and functional code.


Menu 1 Topic 1
Menu 1 Topic 2
Menu 1 Topic 2 Sub 1
Menu 1 Topic 2 Sub 1 Ext 1
Menu 1 Topic 2 Sub 1 Ext 2
Menu 1 Topic 2 Sub 2
Menu 1 Topic 2 Sub 2 Ext 1
Menu 1 Topic 3
Menu 1 Topic 3 Sub 1
Menu 1 Topic 3 Sub 2
Menu 1 Topic 2 Sub 2 Ext 1
Menu 2 Topic 1
Menu 2 Topic 2
Menu 2 Topic 2 Sub 1
Menu 2 Topic 2 Sub 1 Ext 1
Menu 2 Topic 2 Sub 1 Ext 2
Menu 2 Topic 2 Sub 2
Menu 2 Topic 2 Sub 2 Ext 1
Menu 2 Topic 3
Menu 2 Topic 3 Sub 1
Menu 2 Topic 3 Sub 2
Menu 2 Topic 2 Sub 2 Ext 1
An additional Menu added by additional HTML Code
and adding 'mccInitialise('mccMyMenu2') to the <body> onload event.


The mcPart1 includes application notes and the customising variables.




The Style Definitions(typical).




The mcPart2 Functional Code is in the ZIP Download below.



The Code
The Code is in four parts

  • mccPart1 The 'Style' Definitions.
  • mccPart2 Application Note and Customising Variables
  • mccPart3 Functional Code without Notes(about 11K)
  • The HTML Code defining the menu.
MakeMenu will also assist in explaining the code.
mccPart2 is best as an External JavaScripts

All variable, function etc names are prefixed with 'mcc'
to minimise conflicts with other JavaScripts


Tested with IE6, and Mozilla FoxFire.