Forums

This topic is locked

Looking for "close window now" script

Posted 27 Jan 2005 00:48:31
1
has voted
27 Jan 2005 00:48:31 Eric Stieg posted:
Hi folks,

I'm building a few "open browser window" sections of a website, and want to do either of the following, which DWeaver does not have behaviors for. How do I:

1. What's the code to close a pop up window or to close a browser window by having a user click on a "close window now?" I can't find the code or behavior in dreamweaver.

2. Regarding the above, what is the code to have the pop up window or browser window close on "mouse out?" I tried putting using the behavior "on mouse out swop image restore" but it doesn't actually close out the window!

Thx,

Stieger

Oh, that a man's reach should exceed his grasp

Replies

Replied 27 Jan 2005 02:47:12
27 Jan 2005 02:47:12 Dave Thomas replied:
this code is available in DWMX 2004, tho it isnt easy to find as it comes in the form of a submit button.

SHIFT + F9 opens the snippets panel, code is in "Close Window Button"

<pre id=code><font face=courier size=2 id=code><font color=red>
onClick="javascript:self.close();"
</font id=red></font id=code></pre id=code>

for onMouseOut just change the onClick event handler like so:

<pre id=code><font face=courier size=2 id=code><font color=red>
onMouseOut="javascript:self.close();"
</font id=red></font id=code></pre id=code>

forgot to mention that of course the mouse out code cant work with a button, it may have to go in the body tag of the open window. javascript aint my thing <img src=../images/dmxzone/forum/icon_smile_tongue.gif border=0 align=middle>

regards
Dave

Edited by - UltraDav on 27 Jan 2005 02:48:12

Edited by - UltraDav on 27 Jan 2005 03:00:32

Reply to this topic