PDA

View Full Version : Layered DHTML Windows



zac
07-03-2007, 01:34 PM
1) Script Title: Dynamic Window Widget (1.03)

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

3) Describe problem:
Opening an iFrame-type DHTML window inside an existing iFrame-type DHTML window limits size to "parent".


Having previously posted about layering a number of Ajax-type DHTML windows.... thanks .... am now constrained in a couple of places needing to fire javascript onLoad - hence the need to switch to using iFrame-type DHTML windows instead (ho hum).

The problem being that when a link from within an iframe-type DHTML window calls another iframe-type DHTML window, the size of the "child" is restricted to being a maximum of the "parent".

Not a problem shared by ajax-type windows.

Any ideas ? or is there a way to get onLoad to fire for an ajax-type DHTML?

Thanks all

jscheuer1
07-03-2007, 02:56 PM
Well, you can launch an iframe from the top window from within an iframe. Once you are in an iframe, the top window is top or parent. The way this would work out with the widget script depends upon how you would want to do it though. As an example, once you have some iframe widget open on your page, from the page within that, if you wanted to open the Google iframe from the demo, you could do:


<a href="#" onclick="parent.googlewin.show(); return false">Show Window 1</a>

You could also open an entirely new iframe on the parent from within an iframe like so:


<a href="#" onclick="parent.test2=parent.dhtmlwindow.open('testbox2', 'iframe', 'test2.htm', '#11: test2', 'width=250px,height=200px,resize=1,scrolling=1,left=20px,top=100px', 'recal');return false;">test 2</a>

zac
07-03-2007, 03:10 PM
John,

Not sure if I completely understand you..... or if it's just that I'm not being clear.

I have an HTML page that includes the link....

<a href="#" onClick="adminwin=dhtmlwindow.open('adminwin', 'iframe', 'admin.pl?competition_id=$competition_id&organisation_id=$organisation_id', 'Administration', 'width=300px,height=500px,resize=0,scrolling=1,center=1'); return false">Administration</a>

Which pops up a iframe-type window.
Within the "adminwin" is the link...

<a href="#" style="text-decoration: none; color: black;" onClick="parent.adminwin.hide(); venueswin=dhtmlwindow.open( 'venueswin', 'iframe', 'venues.pl', 'Competition Venues', 'width=650px,height=400px,resize=0,scrolling=1,center=1'); return false;">Venues</a>

The second layer is larger than the first layer.

jscheuer1
07-03-2007, 03:25 PM
<a href="#" style="text-decoration: none; color: black;" onclick="parent.adminwin.hide(); parent.venueswin=parent.dhtmlwindow.open( 'venueswin', 'iframe', 'venues.pl', 'Competition Venues', 'width=650px,height=400px,resize=0,scrolling=1,center=1'); return false;">Venues</a>

zac
07-03-2007, 03:36 PM
:D

Super - Easy when you know how.

Now, to crawl back under my rock......