Assigning Text Behaviors “Close Window” and “Open Browser Window” to Text in Dreamweaver

Print Friendly

In Dreamweaver it is fairly simple to assign Behaviors to images (example: open new window, close window, etc.). However, to assign Behaviors to text you have to do a couple of tricks to get it to work. The first is the Close Window and the second is the Open Browser Window.

1. Assigning Text the “Close Window” Behavior

Highlight the text you want to assign a Behavior to and in the Properties palette put

javascript:void(0)

in the Link area.

With the same text still selected; go to the Behaviors palette and click on the + to show the drop down menu.

Choose Call JavaScript from the + menu. In the Call JavaScript windowenter

javascript:window.close();

and click OK.

Now back on the Behaviors palette you will see it has the value of onClick assigned to the Behavior of Call JavaScript (Close Window).

If you wanted, you could now change the onClick to another type by clicking on the “onClick” and making a choice from the menu. But we will be using onClick.

Note if you need to adjust or change the link assigned to the text; just highlight the text again and then the assigned behavior will appear in the Behaviors palette and you can double click on the Call Javascript to re-open the dialogue window.

2. Variation: Assigning Text the “Open Browser Window” Behavior

This makes a pop up window occur from clicking on text.

Highlight the text you want to assign a Behavior to and in the Properties palette put

javascript:void(0)

in the Link area.

With the same text still selected; go to the Behaviors palette and click on the + to show the drop down menu and this time select Open Browser Window.

In the Open Browser Window choose your URL to display by clicking on the Browse… button. Fill in the Window width and height. I usually only check the Scrollbars as needed and Resize handles because all the other options take up more room in the window area and just aren’t needed. Assign the pop up windows name in the Window name box. Click OK and your done.

2 thoughts on “Assigning Text Behaviors “Close Window” and “Open Browser Window” to Text in Dreamweaver

  1. THANK YOU!
    I was going nuts!

    DW doesnt tell you this at all in the manuals/help files. At least not that I could find.
    (only images, not text is in the adobe help)

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image