Dynamically minimizing a DHTML Window
by
, 06-19-2009 at 09:46 PM (68955 Views)
Original Script: DHTML Window
By default the DHTML Window script can only be minimized by clicking on the "minimize" icon located on the upper right of the opened window. Someone asked on the forums if there's a way to do this dynamically, such as via a link instead. Well, certainly. Given the below example DHTML Window:
To dynamically "minimize" it, you can call the internal function:Code:var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://images.google.com/", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")
where "Code:dhtmlwindow.minimize(googlewin.controls.firstChild, googlewin)googlewin
" in the above case is the variable assigned to the DHTML window when you opened it. The following creates a link that minimizes this window:
Code:<a href="#" onClick="dhtmlwindow.minimize(googlewin.controls.firstChild, googlewin)">Minimize Window</a>