Q. How do I change a behavior's event?
A. You change behavior event using the drop down in
the Behaviors panel.
Changing Behavior Events
Author: Daniel
W. Short
Author's Site: Web-Shorts.com
Reference ID: 15614
Changing an Event
By default Dreamweaver applies behaviors onMouseOver for most actions.
Oftentimes you may want an action to happen onClick, such as opening
a full size image of a thumbnail.
To accomplish this, first select the object that has the behavior
attached. This will be the text or image that you want the behavior
attached to. Once you have the text or image selected, open your
behavior panel by choosing Window»
Behaviors.
This panel lists all behavior attached to the currently selected
object. In order to change the Event from onMouseOver to onClick,
follow these steps.
First, click the event in order to select it.
Next,
click the arrow to view all the possible events for this action.
This will cause the drop down menu to appear.
Note: Choosing onClick will activate
that action when the user actually clicks the link. Choosing "Show
Events For" at
the bottom will allow you to choose which events you want to display.
Selecting
events for IE 5.0 will give you list almost four times larger that
the one to the left.
Events for images
Applying events to images can sometimes be problematic. If you
have events for 4.0 and later browsers selected, then onMouseDown
is a valid event for an image. onMouseDown is the default event
for behaviors attached to images. Unfortunately, Netscape will not
apply behaviors attached to an image. The image must be surrounded
with an <a> tag, which has the event triggered onClick. To
fix this, we'll follow these steps:
First,
select the image you've applied the behavior to and open your Behaviors
panel. You should notice that the event is applied onMouseDown.
Click on the Action to activate it and then click the arrow to show
the drop down menu.
This time, your list should be much longer. Notice the difference
between the top set of events and the bottom set of events. Events
without parentheses are attached to the image itself. Events with
parentheses will be attached to the <a> tag wrapping your
image. In order to get your popup windows working in Netscape you
need to change your event to (onClick). This will wrap your image
with the <a> tag and apply the event onClick.
|