View Full Version : Minimize Function [Required]

09-23-2006, 06:45 PM
1) Script Title: DHTML Window

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

3) Describe problem: None, just need an additional function

In the above mentioned script there is a maxmize / restore function used as follows:

function maximize(){
if (minrestore==0){
minrestore=1 //maximize window
document.getElementById("dwindow").style.width=ns6? window.innerWidth-20+"px" : iecompattest().clientWidth+"px"
document.getElementById("dwindow").style.height=ns6? window.innerHeight-20+"px" : iecompattest().clientHeight+"px"
minrestore=0 //restore window
document.getElementById("dwindow").style.left=ns6? window.pageXOffset+"px" : iecompattest().scrollLeft+"px"
document.getElementById("dwindow").style.top=ns6? window.pageYOffset+"px" : iecompattest().scrollTop+"px"

I wanted to ask is there a way to have a "minimize / restore" function?

So that only the title bar of the window shows upon minimization?

Any help appretiated,

09-23-2006, 09:18 PM
You need more than just a function, you need the markup and images to go with it. Also, although this script is rated for Opera 7+, the drag feature doesn't work in that browser and though improved from the original version of this script is a bit unreliable in all browsers. I've fixed that it doesn't drag in Opera, and added the functionality you requested here:


The entire script could use a rewrite though.

09-23-2006, 10:18 PM
WOW! Thanks so much!

Thank you Thank you Thank you Thank you :D


09-24-2006, 12:28 AM
Oh 1 more thing I would like to ask is - is there a way for the browser to remember if the person minimized this window or closed it or maximized it?

So that if the same user returns they get the same preference of viewing they had specified?

I know cookies would be involved, but dont know much and certainly willing to learn. Could you point me in the right direction? And ill do the research from there:)

09-26-2006, 03:29 PM
As I said, the script needed a rewrite so I did that and added the cookie. I'm not sure exactly how you envisioned this working but, this version will remember what was displayed (as far as the state of the DHTML window goes) and reload the page like that. There could be some bugs yet to work out:


Notes: The dragging operation is now much smoother and you cannot drag beyond the borders of the browser window. Also, selecting of text as occurred when dragging in some browsers has been eliminated.

09-26-2006, 06:46 PM
The thing I am trying to achieve is basically slightly different from the above script

In the above a window is called inside an Iframe

however I am calling content directly into DIV's

have a look at my DIV's on this page http://goofy-goobers.com/forum

its a test site I use for experimentation - but notice that the forum functions along with many other things are being called into the DIV

My end objective is to be able to develop a script which will allow board users to display a multitude of content such as:

- PM popups replaced by popup DIVS

- Adverts in DIVs

- Shoutboxes, etc in DIV's

so it would give people a lot of flexibility especially since they can put more things on their pages with less of a clutter

another example of my live site: http://path-to-peace.net/forum here I am using a DIV tag to display the "users online" plus a nav bar

I'll keep working on this - thanks for all your time and help

I hope in the end I can figure it out to work with DIV's as well :)

10-14-2006, 07:52 PM
Hi, thank you to Akulion for referring me here.

I have 2 questions and I would really appreciate any help.
I copy/pasted the Comcast code, and tried it out.
1) How do I make multiple boxes instead of just 1? I'm confused because there is already a dwindow and dwindow1
2) At the comcast site, when a viewer closes the box, and then presses refresh,the box comes back, so the box comes up automatically. But for some reason, when I replaced the url of google with the url of one of my own pages, this didn't happen. Instead, the only way to get back the box was to click the link. How do I get the box to automatically come up upon refresh?

Thanks so much for any help