Applying Behaviors

Dreamweaver makes adding behaviors as easy as selecting a tag and choosing an action from a pop-up menu—in the Behaviors panel.

The Behaviors Panel

The Behaviors panel is mission control for Dreamweaver’s Behaviors. On it, you can see any behaviors that are applied to a tag, add more behaviors, and edit behaviors that are already applied.

You can open the Behaviors panel in any of three ways:

  • Choose WindowBehaviors.

  • Press Shift+F3.

  • If the Design panel is open on the screen, click the Behaviors tab.

In any case, the panel appears on your screen.

Note

Dreamweaver MX includes two different types of behaviors, and it’s important not to get them confused.

This chapter describes JavaScript programs that run in your audience’s Web browsers. The server behaviors listed in the Application panel group, on the other hand, run on the Web server to let you access information from a database. These are described in Part 6.

The currently selected tag is indicated at the top of the Behaviors panel, and a list of all of the behaviors applied to that tag, if any, appears below. Each behavior is listed in two parts: events and actions, as described earlier.

Behaviors, Step by Step

Open the Behaviors panel, and then proceed as follows:

  1. Select the object or tag.

    You must attach a behavior to an HTML tag, such as a link (indicated by the <a> tag) or the page’s body (<body> tag). Take care, however: it’s easy to apply a behavior accidentally to the wrong tag. Form elements, like checkboxes and ...

Get Dreamweaver MX: The Missing Manual now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.