Sandeep's Nook: JavaScript Page

Collapsibe Menu - II

Collapsible Menu - II
+ Computing Links
+ More Links
Sub-Link 1
Sub-Link 2
-------------
+ Few More Links
Sub-Link 1
Sub-Link 2
-------------
Microsoft Corp.
Netscape Corp.
Macromedia Inc.
Symantec Corp.
------------------------
+ JavaScript Links
+ More Links
+ Few More Links
Sub-Link 1
Sub-Link 2
-------------
+ Even More Links
The JS Page
JavaScript Source
Doc JavaScript
------------------------
+ PHP Links
PHP Res. Index
PHP Code Excng.
------------------------

On the left of this page in yellow with black border is the Collapsible Menu - II. The menu has collapsible links. Clicking on those main links with the + symbol in front would open a hidden bunch of links. Such hidden links are mostly related to the main link which opens them. You can add any number of collapsible links or ordinary links to the menu. You can also add unlimited nested sub-links as shown in the example. Additionally if you click a main link it would close other open links related to any other main link while opening its own hidden links. This is applicable to the sub-links under each main link as well. You can completely change the appearance of the menu to best suit your needs.

Note: This script does not work with older browsers like Netscape v4.x but degrades very well.

Author: Sandeep Gangadharan
Home Page: http://www.sivamdesign.com/home/


The script is given below:

This goes in the HEAD of the html file:


This goes in the BODY of the html file: