beautypg.com

Applying built‑in javascript behaviors, Applying built-in javascript behaviors – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 716

background image

Applying built-in JavaScript behaviors

To the top

To the top

To the top

Using built-in behaviors
Apply the Call JavaScript behavior
Apply the Change Property behavior
Apply the Check Browser behavior
Apply the Check Plugin behavior
Apply the Control Shockwave or SWF behavior
Apply the Drag AP Element behavior
Gathering information about the draggable AP element
Apply the Go To URL behavior
Apply the Jump Menu behavior
Apply the Jump Menu Go behavior
Apply the Open Browser Window behavior
Apply the Play Sound behavior
Apply the Popup Message behavior
Apply the Preload Images behavior
Apply the Set Nav Bar Image behavior
Apply the Set Text Of Frame behavior
Apply the Set Text Of Container behavior
Apply the Set Text Of Status Bar behavior
Apply the Set Text Of Text Field behavior
Apply the Show-Hide Elements behavior
Apply the Show Pop-Up Menu behavior
Add, remove, and rearrange pop
-up menu items
Format a pop
-up menu
Position a pop
-up menu in a document
Modify a pop
-up menu
Apply the Swap Image behavior
Apply the Validate Form behavior

Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see

this article

.

Using built-in behaviors

The behaviors included with Dreamweaver have been written to work in modern browsers. The behaviors fail silently in older browsers.

Note: The Dreamweaver actions have been carefully written to work in as many browsers as possible. If you remove code from a Dreamweaver
action by hand, or replace it with your own code, you may lose cross-browser compatibility.

Although the Dreamweaver actions were written to maximize cross-browser compatibility, some browsers do not support JavaScript at all, and
many people who browse the web keep JavaScript turned off in their browsers. For best cross-platform results, provide alternative interfaces
enclosed in

Apply the Call JavaScript behavior

The Call JavaScript behavior executes a custom function or line of JavaScript code when an event occurs. (You can write the script yourself, or
you can use code provided by various freely available JavaScript libraries on the web.)

1. Select an object and choose Call JavaScript from the Add Behavior menu of the Behaviors panel.

2. Type the exact JavaScript to be executed, or type the name of a function.

For example, to create a Back button, you might type if (history.length > 0){history.back()}. If you have encapsulated your code in a function,
type only the function name (for example, hGoBack()).

3. Click OK and verify that the default event is correct.

Apply the Change Property behavior

Use the Change Property behavior to change the value of one of an object’s properties (for example, the background color of a div or the action of

709

This manual is related to the following products: