What Are Behaviors?
A behavior, like an object, is a snippet of code that gets inserted into a Dreamweaver document when the user chooses one from the behaviors list, a behavior adds JavaScript code.
A behavior inserts two pieces of code—a function (in the
document head) and a
function call (in the body section, wherever the cursor is
when the behavior is chosen).

The Behavior panel can be opened through the Window menu, and then the Behaviors option, also by pressing Shift+F3. |
In this panel you need to click on the Some behaviors don't work with some browsers, depending on the selected browser you will see or not see some possible behaviors. There are many behaviors for Internet Explorer but they don't work with Netscape. Once the browser is selected its not necessary to re-select it the following time you want to insert any behavior. When there is an established browser, you can insert behaviors.
|
|
Multiple rollovers
Step 1. Insert your images.
A.
First of all, you have to make your layout or buttons.
I made four buttons and three other images, as you can see.
B.
Open up your copy of Dreamweaver and create a new
html file. Before you start, save the file to your hard drive.
C. Insert "sphere_up" , image"button1_up" and
"button2_up" where you want them to be on your page.
(Use the "insert image" button to insert the images)
Step 2. Naming your images.
A. Click on the "button1_up" image and give it a name in the Property
panel. Do the same thing with the other 2 images.

Just call them:
button1_up = button1
button2_up = button2
sphere_up = sphereup
B. Open up your Behaviors property window. ( Shift+F3
or "Window -> Behaviors" )

Step 3. Applying the behaviors.
A.
Select "button1_up" by clicking on it.
B.
Click on the "+" button in the Behavior window and a dropdown menu
will appear.

C.
Select the "Swap Image" command, and wait for the Swap Image pop up
window to appear.
D.
Now we are going to apply the behaviors on the first button.
Click the "Browse" button and select "button1_over.jpg".
Then click the ok button on the "browse for image window".
Make sure that the "Preload images and Restore images onMouseOut"
are selected. (They should be on by default).

E.
After you have done that, select the "sphereup"
image in the "images" window.
Browse for the right picture, wich in this case is
"sphere1.jpg" and be sure to have "preload images and restore
images onMouseOut" selected like before.
Then click OK.

F. Now it should look like this:
G. Repeat Step no. 03 "A - E" on
"button2_up" using the 2 remaining images (button2_over.jpg &
sphere2.jpg).
The end result:
If this has turned out successfully, the animation should look like this when you view it in your browser (press F12 to preview).