|
January 12, 2002 Related Menus Tips: January 2002
Yehuda Shiran, Ph.D.
|
|
The Menu Builder tool under the Cool Tools section of http://www.docjs.com lets you build a set of related manus. Go ahead and play around with the tool. If we take just two menus, and trim down the URL display functionality, we'll end up with something like this: As you can see, there are three entries in each menu. Change the selected option on the left menu, and see how the right manu changes automatically. Here is the HTML code:
We have two menus, topics and list. An event handler, onChange, triggers a change in list when topics changes. The idea is to display in list options that are related to the selected option in topics. Here is the JavaScript code:
The first section defines the arrays of options. The relate() function initializes list's options to null, and then creates the related list menu, according to the selected topics' options.To read more about related menus, be sure to visit Webreference.com's tutorial.
People who read this tip also read these tips: Look for similar tips by subject: |
| ||||||||||||||||||||