Results 1 to 2 of 2

Thread: Problem with DHTML Window widget

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face Problem with DHTML Window widget

    HI ALL!! first of all congrats with the web and the windows widget script!

    1) DHTML Window widget

    2)http://www.dynamicdrive.com/dynamici...ndow/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:

    Code:
    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

    Thank you very much JS EXPERTS!!!!

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Simply call:

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

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •