Dreamweaver
Site original content, reproduced please indicate the source Web page teaching network .
Awareness of behavioral Events
Behavior is one or more actions taken in response to a specific event. When the specified event is triggered, the corresponding JavaScript program is run and the corresponding action is executed. So when you create the behavior, you must specify an action before specifying the event that triggers the action. Behavior is for all objects in a Web page, and you want to combine an object to add behavior.
Each browser provides a set of events that can be associated with the actions listed in the actions (+) pop-up menu of the Behaviors panel. When visitors to a Web page interact with the page (for example, by clicking an image), the browser generates events, which can be used to invoke the JavaScript function that caused the action to occur. (You can also generate events without user interaction, such as setting the page to automatically reload every 10 seconds.) DW MX 2004 provides a number of common actions that can be triggered using these events.
The events displayed in the Events pop-up menu differ depending on the selected object and the browser specified in the Show Events submenu. To find out which events are supported for the browser given by a given page element, insert the page element into your document and attach a behavior to it, and then view the events pop-up menu in the Behaviors panel. These events are disabled (dimmed) if the related objects do not already exist on the page or the selected objects cannot receive events. If the expected event is not displayed, check to see if the correct object is selected, or change the target browser in the Show events pop-up menu.
If you want to attach the behavior to an image, some events, such as OnMouseOver, are displayed in parentheses. These events are used only for links. When one of them is selected, DW MX 2004 uses a label around the image to define an empty link. In the link text box in the property inspector, the null link is represented as javascript:;. If you want to turn it into a true link to another page, you can change the link value, but if you delete the JavaScript link without replacing it with another link, the behavior is deleted.
In the Action menu, the more actions the newer browsers support, the more we'll get to know them:
(larger picture, please pull the scroll bar to watch)