FrontPage Forums
FrontPage How-To Articles
Website Design Articles
Software & Book Store
Newsletter <- Sign up here!
Website Links
About WebWorkshop.org
Web Design Articles
   
A Super-Simple Drop-Down Navigation Menu
As a website builder and Web surfer (which I'm sure you are), you've probably run into  drop-down menus many times. They're generally pretty intuitive and easy to use. They only have a couple of drawbacks as I see it: They require that JavaScript be enabled in the user's browser, and—let's face it—they're not the most stylish-looking things in the world.

Here's the easiest way I know to add a drop-down navigation menu to your page. If someone can give me an even easier or more compact way to do this, please let me know.

In this example I'm going to have three menu choices: Page One, Page Two, and Page Three. If the users selects Page One, they'll go to page1.htm. If they select Page Two, they'll go to page2.htm. And if they select Page Three... well, you get the picture.

Open your page in the HTML editor of your choice and locate the part of the page you want to menu to appear at (somewhere inside the <body></body> tags, of course). Insert the drop-down menu, using the following code:

<form>
<select onChange="if(options[selectedIndex].value) 
window.location.href=(options[selectedIndex].value)">
<option>Select one...
<option value="page1.htm">Page One
<option value="page2.htm">Page Two
<option value="page3.htm">Page Three
</select>
</form>

You can change the menu items by just using different text (instead of Page One use Home Page, for example). You can also add additional <option> tags, as needed.

Entering your own values for pages (like changing page1.htm to index.htm) should be pretty obvious. You can use absolute URLs (like http://www.webworkshop.org) or relative URLs (like images/index.htm or ../index.htm).

Here's a sample for you to try out. You can come back to this page by using the Back button of your browser.
    

    

<Back to table of contents>

   
Notice: Although every effort has been made to ensure that the information here is correct, be advised that what works on one computer system may not work on another. Use the information you find here at your own risk! WebWorkshop.org and its affiliates are not responsible for any damage or loss due to use (or misuse) of information found here.
   
Copyright ©2001-2004 WebWorkshop.org, all rights reserved
No part of this document may be reproduced without permission from WebWorkshop.org
   
Web Hosting provided by
Intelligent Hosting