Dreamweaver CS3 comes with 34 cross-browser??“compatible actions, and both Adobe and third-party
developers have made many additional actions available. Behaviors greatly extend the range of possibilities
for the modern Web designer??”with no requirement to learn JavaScript programming. All you need to
know about attaching behaviors is presented in the following section.
Attaching a Behavior
When you see the code generated by Dreamweaver, you understand why setting up a behavior is also
referred to as attaching a behavior. As previously noted, Dreamweaver needs a specific HTML tag to assign
the behavior (step 1). The anchor tag
is often used because, in JavaScript, links can respond to several
different events, including onClick. Here??™s an example:
Exit HereYou??™re not restricted to one event per tag or even one action per event. Multiple events can be associated
with a tag to handle various user actions. For example, you may have an image that does all the following
things:
n Highlights when the user??™s pointer moves over the image
n Reveals a hidden AP element in another area of the page when the user clicks the mouse button
on the image
n Makes a sound when the user releases the mouse button on the image
Likewise, a single event can trigger several actions.
Pages:
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787