advertisement -- please support sponsors

closing pop-up windows

Is there a way in which I can open and close windows or dialogs automatically just by waving over a client side image map area just by using "onMouseOver" to open a dialog and "onMouseOut" to close the dialog.

I have been successful in opening both an alert dialog as well as a window, however, I am still unable to close them unless I use a button, which, by the way kills the "way cool" factor associated with what I am trying to do. I open these by using the following code. What can I do???

There's not much you can do for the alert boxes. The user must interact with them to make them go away.

As far as the pop-up windows go, however, the solution is almost trivial. When you open a pop-up window using the open method, be sure to capture the return value in a variable, such as popup.

popup = open ("popupdoc.html");

Later, when it comes time to close the popup window, you can use the value of popup as a reference and call the window's close () method.

popup . close ();

If you put something like this in your onMouseOut event handler, you will have the effect you are looking for.

Charlton Rose
29 August 1997