Chapter 10. Creating Popup Menus


Popup menus are all the rage these days. Surely, you've seen them on the Web. You hover over a navigation choice, and a menu of related items appears. It's a classy effect, as Figure 10.1 shows.

Figure 10.1. Nothing says class like a popup menu.


Popup menus used to be a nightmare to implement. Fortunately, Internet Explorer since version 5 and Netscape since version 6 support a new kind of JavaScript method called getElementById, which simplifies the scripting of all types of interactive features, including popup menus. Browsers capable of understanding getElementId have been available for a couple of years now, and they are now the predominant browsers on the Web by far; so, for most kinds of sites, you can write scripts with this method in good conscience. Older browsers choke, though, so be warned.

GEEKSPEAK

A popup menu is a list of navigation choices that appears when you hover over an item in the main navigation bar.


GEEKSPEAK

Dynamic HTML, or DHTML, is the synergy of HTML, JavaScript, and CSS.


Dynamic HTML, or DHTML, is the synergy of HTML, JavaScript, and Cascading Style Sheets (CSS), all working together to create an interactive Web experience. The typical popup menu is a perfect example of DHTML in action. You build the layout of the nav bar in HTML. CSS elements called layers give you the menus, and a few straightforward JavaScript functions bring the menus to life.



Web Design Garage
Web Design Garage
ISBN: 0131481991
EAN: 2147483647
Year: 2006
Pages: 202
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net