PDA

View Full Version : Problem with DHTML Window widget



djmarki
04-23-2008, 10:17 AM
HI ALL!! first of all congrats with the web and the windows widget script! :)

1) DHTML Window widget

2)http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm

3)Im using Window 4 (Content from a DIV on the page) way of creating popups.

I need that inner div to have a button.
That button should run some code, and, here is my difficulty, close the window.

Im creating my windows in this way:


divwin=dhtmlwindow.open(datosAlerta.ventana, 'div', 'somediv', literalTitulo, 'width=450px,height=220px,left='+leftInicial+'px,top='+topInicial+'px,resize=0,scrolling=0',"recal"); return false;

this code is inside a function, which is called when the page is loaded. Depending several things, 1 or more windows will popup, and the user should be able to close them using that button inside the DIV.

My problem is that i dont know how to close a window, using a custom button inside the popUp.

As you may guess, im a humble newbie in javascript & dhtml :p

Thank you very much JS EXPERTS!!!!

ddadmin
04-23-2008, 07:59 PM
Simply call:

divwin.close() to close the window with variable name "divwin". So a close button inside the DIV would look something like:


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