O'Reilly logo

Dreamweaver MX: The Missing Manual by David Sawyer McFarland

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

Chapter 11. Dreamweaver Behaviors

Chapter 5 makes clear how easy it is to add mouse rollover effects using Dreamweaver’s Rollover Image object. That and other interactive features rely on scripts (small programs) written in the JavaScript programming language.

You could create the same effects without Dreamweaver, but you’d need to take a few extra steps: buy a book on JavaScript, read it from cover to cover, learn about concepts like array, function, and document object model, and spend weeks discovering the eccentric rules governing how different browsers interpret JavaScript code differently.

With Behaviors, however, Dreamweaver lets you add these dynamic JavaScript programs to your Web pages without doing a lick of programming.

Understanding Behaviors

Dreamweaver Behaviors are powerful prepackaged JavaScript programs that let you add interactivity to your Web pages with ease, even if you don’t know the first thing about JavaScript. By adding behaviors, you can make your Web pages do things like:

  • Make layers appear and disappear (see Chapter 12).

  • Require visitors to fill out certain fields in a form (Chapter 10). For example, when you want to make sure an email address or name is entered before the visitor submits the form.

  • Open a new browser window to a specified size, with or without scroll bars, status bar, location bar, and other Web browser “chrome.”

  • Let your visitors navigate a Web site using a pop-up menu.

  • Give feedback to the visitor in a dialog box or in the browser’s status ...

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