A jump menu is a handy navigation element to use when you have a large site with lots of pages. Essentially, it's a quick index to the most common pages on your site, as Figure 8.1 shows. Your visitors select an item from the menu, and a simple JavaScript function causes that particular page to load. This way, your visitors don't have to navigate your site step by step. Figure 8.1. Use jump menus like this one to index the most common pages on your site. Your visitor selects a page from the menu, and the page loads. GEEKSPEAK A jump menu is a quick index to the most common pages on your site. |
To build a jump menu, you need two components: an HTML form (which supplies the doohickey that the visitor clicks, otherwise known as the front end) and a JavaScript function (the quickie program that makes the jump menu work, also called the back end). The toolkits in this topic show you how to create both. TIP A jump menu is a nice extra feature for your site, but don't rely on it for all your navigation. There's no substitute for a good, old-fashioned nav bar. |
When it comes to jump menus, there are two schools of thought. The first is to include a Go button or something for the visitor to click after selecting a page from the menu. Nothing happens until the visitor clicks the button. The alternative is to make the jump menu self-activating. That is, as soon as the visitor selects a page, the jump menu automatically does its thing. Which method is better? It's hard to say. If you include a Go button, your visitors are less likely to make mistakes. If they decide they don't want to use the jump menu after they open it (a favorite of the marketing department), or if they second-guess what page they want, the Go button gives them the option of ignoring the jump menu or making another choice before jumping. On the other hand, the Go button requires another click, which slows your visitors down. A self-activating jump menu requires only one click, so it's faster. You might test both types of jump menus on your site to see which works best, but, when in doubt, give yourself some idiot insurance and include the Go button. | TOOL KITJump Menu with Graphical Go ButtonFront End If you want to use a graphical Go button instead of the generic gray HTML button, all you have to do is design your button in your favorite graphics program. Then, add the following block of HTML to your page to create the menu: [View full width] <form name="jumpmenu" onSubmit="return doJumpMenuGraphicButton();"> <! The form tag above waits for the onSubmit event to launch the jump-menu script. > <! Below is the menu. It works just like the others. Add as many divisions and jump items as you like. > <select name="pages"> <option selected>Choose a page...</option> <option>First category</option> <option value="firstpath">First page name</option> <option value="secondpath">Second page name</option> <option value="thirdpath">Third page name</option> <option>Second category</option> <option value="fourthpath">Fourth page name</option> </select> <! Here comes the graphical Go button. > <input type="image" name="go" src="imagepath" width="imagewidth" height="imageheight" border="0"> </form>
|
|
|