DHTML : Step 2: Animating the menu
Dr Benton
Conclusion
In each of the above-mentioned situations, you should pay attention to the
onMouseOver and
onMouseOut events. If the image used is
link_dn or
mail_dn, these events will trigger calls to functions that handle the rollover effect. You already know about this! But if the image
used is
folder_closed, the function
toggleMenu will be called up to display the sub-menu.
The
toggleStart and
toggleMenu functions are nothing special. They simply concern the change of the layers'
visibility attribute, i.e. they handle the hiding and unhiding of the main menu and sub-menus.
That's it! This workshop should have taught you quite a bit about DHTML and JavaScript! Enough for you to try to understand
the whole script on your own. You can print
the numbered version and follow the execution flow. The explanations given in our workshop should enable you to overcome any difficulties!
You can now proceed to the third and last step of our series. There you will find all the information you require to customise
this dynamic menu and to adapt it to your needs.