View Full Version : DHTML Widget text link to close popup

04-22-2008, 05:27 AM
1) Script Title: DHTML Window widget

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

3) Describe problem:

All I need to know is how to add a text link that will close the window. You can see where I'm using the popup here:


I just want to add a small text link in the bottom right corner that will close the popup and shut off the contents inside (so the video stops playing too).



04-22-2008, 06:11 AM
Simply call dhtmlwindowvar.close() to close a window. For example, if the window was opened using:

googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")

To close it with a link would look something like:

<a href="#" onClick="googlewin.close(); return false">Close Window</a>