Behaviors
are pre-programmed events in Dreamweaver. These are use to perform a certain
action on the page like moving a cursor (mouse pointer) over an image could
trigger the event of a sound being played (play sound) certain message (pop-up
message) will be displayed at a time, when you exit from a page etc.
Behaviors
are created by java script programming but dreamweaver contains several
pre-wirte behaviors that can be inserted into a page using the Behaviors docker
window.
Creating a
behavior consists of two parts:
1.
Actions
2.
Events (state of event)
Procedure:
1.
Select an item (like image, layer etc) to which you
want to apply a behavior.’
Note: if you want to apply any
behaviors to the whole page then select a page using Ctrl+A key before applying
any behaviors.
2.
Go to windows menu and choose Behaviors.
3.
Click on + button of behaviors dialog box and choose
show events for and select IE 2.0 otherwise less amount of events only be
activated.
4.
Again click on +| button and choose the req. Action
like (play sound, pop-up message etc.)
5.
Define needed options related to the actions.
6.
Click on the dropdown arrow of the Events and select
required events (like On click, On Mouse over, on Pageload, on Pageunload etc.)
Go to URL
The Go to
URL action opens a new page in the current window or in the specified frame.
This action is particularly useful for changing the contents of two or more
frames with one click. It can also be called in a timeline to jump to a new
page after a specified time interval.
1.
Select an object and open the Behaviors panel.
2.
Click the plus (+) button and choose Go to URL from the
actions pop-up menu.
3.
Choose a destination for the URL from the Open In list.
The Open In list automatically
lists the names of all frames in the current frameset as well as the main
window. If there are no frames, the main window is the only option.
Note: This action may produce
unexpected results if any frame is named top, blank, self, or parent. Browser
sometimes misktake these names for reserved target names.
4.
Click Broser to select a document to open, or enter the
path and filename of the document in the URL field.
5.
Repeat step 3 and 4 to open additional documents in
other frames.
6.
Click OK.
7.
Check that the default event is the one you want.
If it isn't choose 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.
Open Browser Window
Use the Open Browser Window action to open a URL in a new window.
You can specify th 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; wiht 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 that launched it. 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 640 x 480 pixels and have a navigation
bar, location toolbar, status bar, and menu bar. 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 and has no navigation bar, no location
toolbar, no status bar, no menu bar, resize handles, and no scroll bars.
To use the Open Browser Window action:
1. Select an object and open the Behaviors panel.
2.
Click the plus (+) button and choose Open Browser Window from the
Actions pop-up
menu.
3. Click Browser to select a file, or enter the URL you want to display.
4. Set any of the following options:
Window Width specifies the width of the window in pixels.
Window Height specifies the height of the window in pixels.
Navigation Toolbar is the row of browser buttons that includes Back, Forward, Home,
and Reload.
Location Toolbar is the row of browser options that includes the location field.
Status Bar is the area at the bottom of the browser window in which messages (such as
the load time remaining and the URLs associated with links) appear.
Menu Bar is the area of the browser window (Windows) or the desktop (Macintosh)
where menus such as File, Edit, View, Go, and Help appear. You
should explicitly set
this option if you want visitors to be able to navigate from the new window. if you do not
set this option, the user can only close or minimize the window (Windows) or close it
Window or quit the application (Macintosh) from the new window.
Scroll bars as Needed specifies that scroll bars should appear if the content extends
beyond the visible area. If you do not explicitly set this option, scroll bars do not appear.
If the Resize Handles option is also turned off, visitors have no easy way of seeing content
that extends beyond the original size of the window. (Though they may be able to make the
window scroll by dragging off the edge of the window.)
Resize Handles specifies that the user should be able to resize the window, either by
dragging the lower right corner of the window or by clicking the maximize button
(windows) or size box (Macintosh) in the upper right corner. if this option is not
explicitly set, the resize controls are unavailable and the lower right corner is not
drag gable.
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.
5. Click OK.
6. Check that the default event is the one you want.
If it isn't, choose 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.