Invoking a JavaScript behavior can specify a custom function or JavaScript code to execute when an event occurs. You can write these JavaScript code yourself, or you can use a variety of JavaScript libraries that are free on the web.
One, Dreamweaver invoke JavaScript behavior
1. Select an object.
2. Open the Behavior panel.
3. Click the "Add behavior (+)" button and select "Invoke JavaScript" from the Drop-down menu that pops up. As shown in the following illustration:
4. In the Call JavaScript dialog box, enter the name of the custom function or JavaScript code you want to perform. As shown in the following illustration:
5. Click on "OK" button, then give the selected object invoke JavaScript behavior.
The source code is as follows:
Dreamweaver CS5 invoke JavaScript behavior sample
Closes the window when the mouse is passing!
Some functions or JavaScript source code need to be modified and debugged to be used correctly.
6. See if the event attached above is a required event. If the event is not needed, you can modify the event.
7. See if the behavior parameters are appropriate. You can also modify the behavior parameters if they are not appropriate.