O'Reilly logo

The JavaScript PocketGuide by Lenny Burdette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14. Drop-Down Menus

Drop-down menus are ubiquitous on computers, both in desktop software and on the Web. They can be useful tools for organizing the hierarchy of a complex Web site by hiding deeper pages in submenus until the user needs them. This chapter demonstrates how to build a simple menu system using the MooTools JavaScript library.

Menu HTML

The basic HTML document should be fairly unsurprising if you’ve read the previous example chapter.

image

It includes two important details to notice:

• The <html> tag has a class name called no-js, which you’ll use for fallback behavior in the CSS.

• The first <script> element loads the MooTools library ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required