A flexible multi-level UL/LI constructor
am 09.09.2007 00:34:53 von tuxedoHi!
Some time ago I received much help on this group in piecing together a
fairly simple two-level HTML list but where conditional output depending on
a current page variable and various other peculiarities were required.
For a similar but somewhat more complex purpose, I'd like find a suitable
method of generating the following nested HTML list structure:
o Heading 1
o Subject 1.1
o Subject 1.2
o Sub heading 1.3
o Subject 1.3.1
o Subject 1.3.2
o Subject 1.4
o Subject 1.5
Ultimately, the list will be converted by CSS and Javascript into a typical
drop-menu. This allows text browsers to gracefully fall back on the
original list structure, while presenting most people with a fancy
drop-menu. The complete HTML output would appear as follows:
The above example would generate one multi-level drop-menu only, while in
reality, the complete navigation system will consist of several drop-menus
which are all aligned horizontally in a typical page header style.
Some menus may include two, three, four and even five level UL's. One level
only can also exist in the odd situation, which would simply display a
top-level link without a drop-menu.
Each menu will be placed within separate