PDA

View Full Version : Close button function for modal windows



jrootham
03-04-2009, 05:30 PM
1) Script Title: ::DHTML Modal window v1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm

3) Describe problem:

I would like to call a function when the window is closed via the close button but not when it is closed any other way.

Is there an already implemented way of doing this?

I assume the way to do this is to add a new property in the constructor and set it to null there and execute the function pointed to by that property (if not null) in the code that implements the close button. Is that a good approach?

Nile
03-05-2009, 12:03 AM
You can either use something like this (http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm).

Or just not put a button that has the onClick event:


parent.window.hide()