Project Management

Stupid Web Tricks: Menu mien

Use this JavaScript to help users navigate your Web site.

Click here for our complete list of Stupid Web Tricks.

By Holly Cunningham

The biggest benefit of your mannerly deportment is knowing how to make a graceful exit, or at least finding an unobtrusive way to change the current topic of your cocktail conversations. It's only good hostessing to extend your best Geneva-finishing-school restraint to your Web site's visitors. After all, while you may want to go on and on at scrolly length about this or that dissertation-related inanity or display full-body shots of your pet giraffe, it's not really kind to make your guests go hunting for the menu, with its built-in escape routes. This is especially true when the Back button and freedom from your site always sit so close at hand. What can you do that doesn't detract from the look of your one-page masterpiece the way chasing visitors with a full-blown "Pay attention to me!" menu would? Our ever-so polite answer: a discreet little bit of DHTML menu-ing that has silver-service waiter qualities—always at hand but appearing only when beckoned.

Close, but not too close

With this marriage of convenience between JavaScript and CSS, your menu's courtliness will be irreproachable. Make a menubar.gif, and put it in the directory where your Web page resides. Place this script into the <head> of your Web page.

Menu mien <head> script

Click here.

Next, add your <head> tags, which hold the table with your menu. Change the text, links, and hexadecimal values to reflect your own site's design:

Click here.

Use the menu mien script to enhance the experience of all visitors who navigate your site. If they have a positive experience, it increases the likelihood that they'll return.

Holly Cunningham, a frequent contributor to CNET, is a freelance Web designer who works primarily to keep her Chihuahua in furs.

Editor's Picks

Free Newsletters, In your Inbox