Snippet. Snippets. Syntax. Float. O'Reilly CodeZoo. BleedingEgo - Expandable Listmenu Script. One of the requirements of our new website at work was to create a list menu where you could click on some elements to expand/close different sections of the menu, similar to windows explorer.
The challenge I set myself was to create a script that required minimal markup changes and one that would degrade nicely in the majority of browsers. I was aware of the expandable menus already available on Gazingus but I felt the amount of HTML markup you had to change to make the code work with the script was unsatisfactory for my needs. I needed to keep the markup simple as some of the menus would be written by people who's HTML skills were not necessarily very advanced.
The following script is the result of my efforts, it appears to degrade well in all the browsers I've tested and if there is no scripting enabled in the browser then the entire list will appear. Koders - Source Code Search Engine.