PDA

View Full Version : Maximizing Window



Sachin20082008
10-16-2008, 05:09 AM
1) Script Title:
DHTML Window widget (v1.1)
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/index.htm
3) Describe problem:
There is no built in facility for maximizing the Window (If maximized it should span all over its container).
What changes I have to make to provide maximize facility ?

Regards,
Sachin.

ddadmin
10-16-2008, 08:36 AM
This is probably something I'll be adding to the script the next time it's updated. In the meantime, are you talking about adding a "maximize" icon to every DHTML window, or just come up with a function that can be run where you want (ie: a link) to maximize the window? The later is simpler.

Sachin20082008
10-16-2008, 02:09 PM
Actually i am thinking of adding a "maximize" icon to every DHTML window.
But can u tell me how should I maximize the window using link?
Also how should I open the window already maximized ?

Thanks,
Sachin

ddadmin
10-17-2008, 05:21 PM
Regarding maximizing a DHTML window via a link, assuming you have the below window instance that opens automatically:


<script type="text/javascript">

var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://www.google.com", "#1: Google Web site", "width=590px,height=350px,resize=1,scrolling=1,center=1", "recal")

</script>

A generic function that maximizes the above may look like this:


function maximizewin(winvar){
winvar.moveTo(dhtmlwindow.scroll_left, dhtmlwindow.scroll_top)
winvar.setSize(dhtmlwindow.docwidth-10, dhtmlwindow.docheight)
}

For example:


<a href="javascript:maximizewin(googlewin)">Maximize DHTML window</a>

In other words, the key is to call dhtmlwindow.moveTo() and dhtmlwindow.setSize().

wcsadmin
10-21-2008, 10:40 PM
Hi, actually I am using the Window widget to open external links on a links page. I would like the maximize function on every window (no link). I have been able to add to maximize image to the windows, but I don't know enough about javascript to add the functionality. Can someone please help? Usual tight deadline. Thanks in advance! Di

ddadmin
10-22-2008, 05:32 PM
Hi wcsadmin:
Try the below modified dhtmlwindow.js if you wish every DHTML window to be maximized (covering the entire visible page).

wcsadmin
10-22-2008, 09:12 PM
Thanks! I'll give it a try and post back tomorrow.

wcsconcierge
10-24-2008, 08:57 PM
Hmm ... I think I didn't clearly communicate what I was trying to do. The link is preloaded in a particular window size. I reprogrammed dhtmlwindows.js so the MIN, MAX, and CLOSE buttons are now at the top of the window. I wanted to add the maximize functionality to the MAX button. When the window is MAXIMIZED, the RESIZE icon should appear in its place. When the RESIZE button is clicked, the window would return to its original size. Just like a regular window.

Maddawg6
05-13-2010, 09:43 PM
3306

Although this blog is a little old I recently came across the need for this script and wanted it to maximize as well. I updated the .js file to accomodate the ability to maximize. Unfortunately the script was written to replace the min, max, restore icons respectively.

To elaborate: when you click Minimize, the minimized window now will replace the min with restore. The max icon shows but is not functional (close still works). When you click Maximize, the maximized window will replace the max with restore. The min icon shows but is not functional.

I'm muddling through the script to try and achieve functionality within any state. Hopefully this benefits someone other than just me... :)