Dreamweaver MX: Closing Pop Up Windows with Text Links
Version: Dreamweaver
MX
Level: Basic
Objectives: To add the
necessary JavaScript to close your pop up windows
Tools & Techniques: Behaviors,
close window, JavaScript, pop up windows
Part 1: Closing a Pop Up Window with a Text Link
Generally, the "Close Window" link is at the bottom of the pop
up page but you're welcome to put it anywhere you like.
Type out the text on your page. In this case, I'll use: "Close
Window"
Select the text and in the Property inspector, add the following
code:
javascript:self.close()
That should do it. Go ahead and save your page and give it a try.
Part 2: Closing a Pop Up Window with an Image
Closing a window with an image is the same as with text links.
Just add the same script to the image as you did the text link
to make
it work.
Select the image you want to use to close the window and add the
following line of code to your Property inspector:
javascript:self.close()
|