Apply the open browser window behavior, Apply the play sound behavior, Apply the popup message behavior – Adobe Dreamweaver CC 2015 User Manual
Page 427: Apply the preload images behavior

420
Javascript
Last updated 6/3/2015
Apply the Open Browser Window behavior
Use the Open Browser Window behavior to open a page in a new window. You can specify the properties of the new
window, including its size, attributes (whether it is resizable, has a menu bar, and so on), and name. For example, you
can use this behavior to open a larger image in a separate window when the visitor clicks a thumbnail image; with this
behavior, you can make the new window the exact size of the image.
If you specify no attributes for the window, it opens at the size and with the attributes of the window from which it was
opened. Specifying any attribute for the window automatically turns off all other attributes that are not explicitly turned
on. For example, if you set no attributes for the window, it might open at 1024 x 768 pixels and have a navigation bar
(showing the Back, Forward, Home and Reload buttons), location toolbar (showing the URL), status bar (showing
status messages, at the bottom), and menu bar (showing File, Edit, View and other menus). If you explicitly set the width
to 640 and the height to 480 and set no other attributes, the window opens at 640 x 480 pixels, without toolbars.
1
Select an object and choose Open Browser Window from the Add Behavior menu of the Behaviors panel.
2
Click Browse to select a file, or enter the URL you want to display.
3
Set the options for window width and height (in pixels) and for the incorporation of various toolbars, scroll bars,
resize handles, and the like. Give the window a name (use no spaces or special characters) if you want it to be the
target of links or want to control it with JavaScript.
4
Click OK and verify that the default event is correct.
Apply the Play Sound behavior
This behavior has been deprecated as of Dreamweaver CS5.
Apply the Popup Message behavior
The Popup Message behavior displays a JavaScript alert with the message you specify. Because JavaScript alerts have
only one button (OK), use this behavior to give the user information rather than to present 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 ({}). To display a brace, precede it with a backslash (\{).
Example:
The URL for this page is {window.location}, and today is {new Date()}.
Note: The browser controls the appearance of the alert. If you want more control over the appearance, consider using the
Open Browser Window behavior.
1
Select an object and choose Popup Message from the Add Behavior menu of the Behaviors panel.
2
Enter your message in the Message box.
3
Click OK and verify that the default event is correct.
Apply the Preload Images behavior
The Preload Images behavior shortens display time by caching images that are not shown when the page first appears
(for instance, images that will be swapped in with behaviors or scripts).
Note: The Swap Image behavior automatically preloads all highlight images when you select the Preload Images option in
the Swap Image dialog box, so you do not need to manually add Preload Images when using Swap Image.
1
Select an object and choose Preload Images from the Add Behavior menu of the Behaviors panel.