Dreamweaver
· The use of behavior
You can attach the behavior to the entire document (that is, to the body tag), and you can attach to any of the links, images, form elements, or a variety of other HTML elements. The target browser that you select determines which events are supported by the given element.
You cannot attach a behavior to plain text. Labels such as p and span do not generate events in the browser, so actions cannot be triggered from these tags. However, you can attach the behavior to the link.
To attach a behavior to plain text, do the following:
In the property inspector, enter JavaScript in the link text box:;. Be sure to include colons and semicolons.
Tip: You can also use the number symbol # in the link text box. The problem with numeric symbols is that when a visitor clicks the link, some browsers may jump to the top of the page. Clicking the "JavaScript:;" Empty link does not produce any effect on the page.
Open the Behaviors Panel (Window > behavior) While the text is still selected.
Select an action from the Actions pop-up menu, enter a parameter for the action, and then select an event that triggers the action.
To change the appearance of the linked text so that it does not look like a link, do the following:
Select View-->> code to open the Code view of the document window. Find the link. In the link's a href tag, insert the following attribute: style= "Text-decoration:none;" Color:red ". This property setting disables underlining and sets the color of the text to red.
Note that this property is an inline CSS style. An inline style applied to a single link overrides other CSS styles that apply to the link, but does not have any effect on the part outside the link. To change the appearance of linked text throughout the page or across the site, use CSS styles to create a new style for the link.
You can specify more than one action for each event.
To attach additional behaviors, do the following:
Select an element on the page, such as an image or a link. To attach the behavior to the entire page, click <body> label in the tag selector on the left side of the document window.
Select window-->> behavior to open the Behaviors panel.
Click the plus (+) button and select an action from the Actions pop-up menu.
Dimmed actions in the menu are not selectable. The reason they are grayed out may be that a required object is missing from the current document. For example, if the document does not contain Shockwave or Macromedia Flash SWF files, the control Shockwave or flash action is grayed out. If no event is available for the selected object, all actions are grayed out.
When you select an action, a dialog box appears, showing the parameters and description of the action. Enter a parameter for the action, and then click OK.
The default event that triggers the action appears in the Events column. If this is not the trigger event that you want, select another event from the Events pop-up menu.