View Full Version : DHTML window widget get title in iframe page

01-19-2010, 10:36 PM
1) Script Title: Dynamic Drive DHTML window widget

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

3) Describe problem:

I have created an iframe popup window using this script, and basically i want to create a function in the js file so i can access the popups title in the iframe page...

01-20-2010, 09:54 AM
is the ifreme page of the same domain as the parent page launching the DHTML window? Also, by access the title, do you mean store it in a variable, or use it somewhere as part of the window's interface?

01-20-2010, 02:22 PM
I figured it out

I just changed the following in the dhtmlwindow.load function




then accessed it in php on the iframe page

but I have one more question how would i go about minimizing and restoring the window using a button

basically I have added some code to add a button to my menu and i want it to hide/show the window onclick how would i do this

This is the code i tried but it doesn't seem to work:

var fishEyeElement = document.getElementById('fishEye');

fishEyeElement.innerHTML = fishEyeElement.innerHTML + '<li id="fisheye_'+t+'"><a class="dockItem" onclick="if(document.getElementById(\''+t+'\').style.display == \'none\') { dhtmlwindow.restore(\'Minimize\', \''+t+'\'); }else{ dhtmlwindow.minimize(\'Restore\', \''+t+'\') }"><img src="images/dock/'+t+'.png" alt="Home" title="Example&nbsp;1" /></a></li>'

01-21-2010, 10:58 AM
Per this post (http://www.dynamicdrive.com/forums/blog.php?b=31), to create a link that restores a DHTML window, try the syntax:

<a href="#" onClick="dhtmlwindow.minimize(googlewin.controls.firstChild, googlewin)">Minimize Window</a>

where "googlewin" in the above case is the variable assigned to the DHTML window when you opened it. For a restore link, the following should do it:

<a href="#" onClick="dhtmlwindow.restore(googlewin.controls.firstChild, googlewin)">Minimize Window</a>