Results 1 to 2 of 2

Thread: DHTML Window Widget Links

  1. #1
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question DHTML Window Widget Links

    1) Script Title: DHTML Window Widget

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

    3) Describe problem:

    Is there a way to make links in the popup window control the main window. As an example, if there is a link in the popup window that loads google, currently it would load google in the popup window. I would like it to close the popup and load google in the main window.

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

    Default

    Certainly. You can access the main window from within the popup window via JavaScript. Supposedly you've opened a DHTML window on the main page using the following:

    Code:
    var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")
    Inside the popup window window, to refer back to the main window, you'd use the code:

    Code:
    parent
    So to do what you're trying to do, you may create a call a function such as the following within your popup window:

    Code:
    function goto(){
    	parent.googlewin.close()
    	parent.location='http://google.com'
    }
    DD Admin

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
  •