12.2 Using BehaviorsUsing behaviors is an easy three-step process:
The action that you want to take dictates which behavior you'll use. You'll often want to react to user activities, such as mouseclicks, keyboard entry, or resizing the browser. These and other events can be used to trigger actions; the browser will run the chosen behavior automatically when the designated event occurs. You must decide where to apply a behavior in order to limit its scope to the events you are interested in. For example, you might take some action when the user clicks on a button, but you might ignore mouseclicks elsewhere. Therefore, you'll attach your behaviors to HTML elements, such as images, buttons, text, or the body tag. Sometimes a behavior applied to one tag influences another HTML element. For example, a behavior applied to a checkbox could be used to change the properties of another element or to update the contents of a frame. You'll typically configure a behavior's parameters using Dreamweaver's friendly UI. For example, when using the Open Browser Window behavior you'll specify parameters for the window's height and width (see Figure 12-11). There you have it! Just attach a behavior (action) to an HTML element, tell Dreamweaver what event to use as a trigger, and provide parameters to customize the behavior for your particular needs. Let's see how. |