SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 785 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"


Here??™s how it works. Suppose you want to trigger a custom JavaScript function called showTotal() whenever
the user clicks a special graphic:
1. Select the image, and in the Link field of the Property inspector, enter javascript:;.
2. In the Behaviors panel, click the Event column and choose an event from the drop-down list. In
this case, select onClick.
3. Enter the custom function call and any arguments in the Action column. The function might be
entered like this: showTotal(???checkout??™,??™USD??™), where the two arguments are presented
in a comma-separated list, using single quotes.
4. Press Tab to confirm the code entry.
If you check the surrounding the image, you find that Dreamweaver has now added the following to the
tag: onClick=???showTotal(???checkout??™,??™USD??™)???.
The function call or arguments can include dynamic components; a lightning bolt symbol that opens the
Dynamic Data dialog is available from the Action column. Moreover, you can combine your custom function
call with other standard behaviors. To remove the code, select the custom entry and click Remove (??“), just as
you would for a regular behavior.
Standard actions
As of this writing, 34 standard actions ship with Dreamweaver CS3. Each action operates independently of
and is different from the others, although many share common functions.


Pages:
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797