PDA

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



vinny.benson
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...

ddadmin
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?

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

I just changed the following in the dhtmlwindow.load function



window.frames["_iframe-"+t.id].location.replace(contentsource)


TO



window.frames["_iframe-"+t.id].location.replace(contentsource+'?title='+title)

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>'

ddadmin
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>