Macromedia dreamweaver 8-using dreamweaver User Manual
512
Chapter 18: Using JavaScript Behaviors
Window Name
is the name of the new window. You should name the new window if you
want to target it with links or control it with JavaScript. This name cannot contain spaces
or special characters.
or special characters.
5.
Click OK.
6.
Check that the default event is the one you want.
If it isn’t, select another event from the pop-up menu. If the events you want are not listed,
change the target browser in the Show Events For pop-up menu.
change the target browser in the Show Events For pop-up menu.
Play Sound
Use the Play Sound action to play a sound. For example, you might want to play a sound
effect whenever the mouse pointer rolls over a link, or you might want to play a music clip
when the page loads.
effect whenever the mouse pointer rolls over a link, or you might want to play a music clip
when the page loads.
To use the Play Sound action:
1.
Select an object and open the Behaviors panel.
2.
Click the Plus (+) button and select Play Sound from the Actions pop-up menu.
3.
Click Browse to select a sound file, or enter the path and filename in the Play Sound text
box.
box.
4.
Click OK.
5.
Check that the default event is the one you want.
If it isn’t, select another event from the pop-up menu. If the events you want are not listed,
change the target browser in the Show Events For pop-up menu.
change the target browser in the Show Events For pop-up menu.
Popup Message
The Popup Message action displays a JavaScript alert with the message you specify. Because
JavaScript alerts have only one button (OK), use this action to provide information rather
than to present the user with a choice.
JavaScript alerts have only one button (OK), use this action to provide information rather
than to present the user with a choice.
You can embed any valid JavaScript function call, property, global variable, or other
expression in the text. To embed a JavaScript expression, place it inside braces (
expression in the text. To embed a JavaScript expression, place it inside braces (
{}
). To display
a brace, precede it with a backslash (
\{
).
NO
TE
Browsers may require some kind of additional audio support (such as an audio plug-in)
to play sounds. Therefore, different browsers with different plug-ins often play sounds
differently. It’s difficult to predict reliably how visitors to your site will experience the
sounds you provide.
to play sounds. Therefore, different browsers with different plug-ins often play sounds
differently. It’s difficult to predict reliably how visitors to your site will experience the
sounds you provide.