Dreamweaver 4 concise tutorial (8. Add interactive effects to web pages 2)
Author:Eve Cole
Update Time:2009-05-30 18:35:33
8. Add interactive effects to web pages
Create more complex interactive effects
In Dreamweaver, more complex effects are achieved through a function called Behaviors. Behaviors literally means "behavior", which we also call event responses. Through changes in web page elements, such as mouse movement, clicks and other "events" (Events), triggering pop-up windows, closing the page and other "responses" (Actions), it is an event response. And thankfully, the making of "The Act" is almost foolproof.
Press Shift+F3 to open the behavior panel, as shown below:
Adding behavior to a web page requires the following three steps:
1. Select the elements that generate the behavior, such as pictures, text with links, layers, etc. If you want the effect to start appearing as soon as the page loads, you can select Label 2 on the status bar and press The button selects a response (different elements have different corresponding responses) and sets the properties of this response in the subsequent dialog box; the following is a description of the responses that can be selected:
Call JavaScript: Call a piece of JavaScript;
Change Property: Change the CSS style of the Html tag;
Check Browser: Enter different pages according to different browsers;
Check Plugin: Check whether the browser has the necessary plug-ins;
Control Shockwave or Flash: Control the playback of Shockwave or Flash animation;
Drag Layer: Allows the viewer to drag elements in the layer;
Go To URL: Link to the specified URL;
Jump Menu, Jump Menu Go: Jump menu and Go button;
Open Browser Window: Open a new browser window;
Play Sound: play sound;
Popup Message: Pop up warning window;
Preload Images: Read images in advance;
Set Nav Bar Image: Set the image of the navigation bar;
Set Text: Display text in a specific place;
Show Hide Layer: Show or hide the layer;
Swap Image, Swap Image Restore: Transform pictures and restore original pictures;
Timeline: Control the playback of timeline;
Validate Form: Verify the correctness of the form;
Get More Behaviors: Download more behavioral events.
3. Select Events to decide under what circumstances the response is triggered. Common events include:
onMouseOver: The mouse moves to the target;
onMouseUp: when the mouse is pressed and then the left button is released;
onMouseOut: when the mouse moves away;
onMouseDown: When the mouse is pressed (no need to release the left button);
onClink: when clicked;
onDblClick: when double-clicked;
onLoad: When loading a web page;
onUnload: when leaving the page;
onResize: When the viewer changes the size of the browsing window;
onScroll: When the viewer drags the scroll bar.