Apply a behavior, Change or delete a behavior – Adobe Dreamweaver CC 2015 User Manual
Page 421

414
Javascript
Last updated 6/3/2015
To see which tags you can use with a given event in a given browser, search for the event in one of the files in the
Dreamweaver/Configuration/Behaviors/Events folder.
Apply a behavior
You can attach behaviors to the entire document (that is, to the
tag) or to links, images, form elements, andseveral other HTML elements.
The target browser you select determines which events are supported for a given element.
You can specify more than one action for each event. Actions occur in the order in which they’re listed in the Actions
column of the Behaviors panel, but you can change that order.
1
Select an element on the page, such as an image or a link.
To attach a behavior to the entire page, click the
tag in the tag selector at the lower-left corner of theDocument window.
2
Choose Window > Behaviors.
3
Click the Plus (+) button and select an action from the Add Behavior menu.
Actions that are dimmed in the menu can’t be chosen. They may be dimmed because a required object doesn’t exist
in the current document. For example, the Control Shockwave or SWF action is dimmed if the document contains
no Shockwave or SWF files.
When you select an action, a dialog box appears, displaying parameters and instructions for the action.
4
Enter parameters for the action, and click OK.
All actions provided in Dreamweaver work in modern browsers. Some actions do not work in older browsers, but
they will not cause errors.
Note: Targeted elements require a unique ID. For example, if you want to apply the Swap Image behavior to an image,
the image requires an ID. If you don’t have an ID specified for the element, Dreamweaver automatically specifies one
for you.
5
The default event to trigger the action appears in the Events column. If this is not the trigger event you want, select
another event from the Events pop-up menu. (To open the Events menu, select an event or action in the Behaviors
panel, and click the downward-pointing black arrow that appears between the event name and the action name.)
Change or delete a behavior
After attaching a behavior, you can change the event that triggers the action, add or remove actions, and change
parameters for actions.
1
Select an object with a behavior attached.
2
Choose Window > Behaviors.
3
Make your changes:
• To edit an action’s parameters, double-click its name, or select it and press Enter (Windows) or Return
(Macintosh); then change parameters in the dialog box and click OK.
• To change the order of actions for a given event, select an action and click the Up or Down arrow. Alternatively,
you can select the action and cut and paste it into the desired location among the other actions.
• To delete a behavior, select it and click the Minus (–) button or press Delete.