PDA

View Full Version : DHTML Window Widget Links



dominicw
03-18-2009, 08:55 PM
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.

ddadmin
03-18-2009, 09:54 PM
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:


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:


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:


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