View Full Version : DHTML Window widget - mod

06-27-2007, 04:50 PM
1) Script Title: DHTML Window widget (v1.03)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ndow/index.htm

3) Describe problem: Not a problem. This script works bueatifully. Many cheers and profound appreciation.
What I have is a function that creates/shows the ajax / iframe windows. I don't need the smaller minimumized box to expand the window. Is there any way to get rid of it?

Thanks a bunch! :)

06-28-2007, 05:37 AM
Do you mean you simply wish to get rid of the "minimize" icon within the window interface? You can do this easily, though the changes would be applied to all DHTML windows. Inside the .js file, just edit the below:

domwindowdata+='DHTML Window <div class="drag-controls"><img src="'+this.imagefiles[0]+'" title="Minimize" style="display:none" /><img src="'+this.imagefiles[1]+'" title="Close" /></div>'

The part in red is new.

06-28-2007, 10:37 AM
Almost but not quite.
Not sure if I'm right - but I think the minimize icon is a toggle.
Hiding the main window and displaying the small one.
I still need the icon to hide the main window.
I just don't need the small one displayed.

06-28-2007, 11:26 AM
I can see now that it is more complex than that.
I've gone through all of the style.display="block" s without finding it.
And if none of them do it - then my toggleing routine won't work either. <sigh>
yes it will - all it does is call show();

06-28-2007, 06:45 PM
Hiding the main window and displaying the small one.
I still need the icon to hide the main window.
I just don't need the small one displayed.

Hmmm I'm confused on what you're trying to do then. The "close" icon is what toggles the hiding/showing of the window, and remains untouched. What's gone with the above change is the "minimize/restore" icon.

Can you elaborate on what you're trying to remove from the interface?

06-29-2007, 08:30 PM
OK - sorry for the delay
I'm not quite a nob but you do some things I haven't learned yet - so Please correct me if I am wrong. - As I see it
the variables assignment creates/opens the widget
the Min button expands/contracts the div between it's 2 sizes
The Close buttons call the close function which trys the onclose function.
--- This is what I'm trying to do ---
I'm using a function that looks to see if the variable is null & either assigns it or calls varName.show(). It also stores a cookie so varName is reload it if the page is refreshed. - working
A custom onclose function deletes that cookie. - working
--- My problem is ---
The Minimize button is a toggle that hides the inner div / changes the Min button & repositions of the widget. All I need it to do is hide the widget
--- This seems to work ---
I commented out everything in
minimize:function(button, t){ and added
t.style.display="none" which seems to be working. The only reason I said seems - is that when it's restored - the widget returns to the original position.

06-29-2007, 08:59 PM
So basically you just want the minimize icon to do the exact same thing as the close icon, but without executing any custom function? If so, you're basically there. Replace everything inside function minimize() with the following:

dhtmlwindow.rememberattrs(t) //remember window's dimensions/position on the page before closing

06-29-2007, 09:50 PM
Thank You :)