You can enter either plain text, which is rendered
in the default paragraph style, or any amount of HTML code, including
![]()
,
,
or other tags.
395
Working with Divs and AP Elements 11
Targeted JavaScript Commands
You can enter the following simple yet useful JavaScript commands in the Snap JavaScript text box of the
Drag AP Element dialog box:
n To display a brief message to the user after the AP element is dropped, use the alert() function:
alert(???You hit the target???)
n To send the user to another Web page when the AP element is dropped in the right location, use
the JavaScript location object:
location = ???http://www.yourdomain.com/yourpage.html???
The location object can also be used with relative URLs.
If you??™re entering a large amount of HTML, don??™t bother doing so by hand??”Dreamweaver
can do it for you. On a blank page, create your HTML content and then select and copy it.
Then, in the Set Text of Container dialog box, paste the code using Ctrl+V (Command+V).
7. Click OK when you??™re finished.
If you want several AP elements to change when a single event is triggered, just add more Set Text of
Container behaviors to the same object.
You may need to change the behavior event from its default; to do so, click the down arrow in
between the Event and Action columns on the Behaviors panel and choose a new event from
the list.
Pages:
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780