Menu 1 Menu 2 Select 1 | This page demonstrates how to generate pop-up menus using dynamic HTML. This example supports only a single level of pop-up. One option displays a second pop-up, but the first pop-up disappears when the mouse moves to the next level. | |
This explains the Style Sheet. Notice that the names can not include underscores.
The style sheet and Java Script are placed in separate files in order to make them re-useable - the menus may be identical on several pages of your site.
When a page is initially loaded, IE 5 reads the complete page before executing any code. As a result, the menu names (div tags) are known when the first onMouseOver is called. However, if the mouse cursor happens to be on top of a link when the page opens, Netscape 4 executes the onMouseOver code before the div tags are interpreted and, therefore, genenerates an error. As a result, it is very important to place the menu definitions before any code (links) that references them.
Javascript Update - New Netscape
If anyone needed a reason not to support Netscape, this is it. Dropping support of a major language construct (like this one) requires millions of web pages to stop working. The cost for so many people to fix all those pages is unbelievable.
I have expressed my opinion of deprecating tags and language features elsewhere - I am totally against it when it directly affects so many people.