...

View Full Version : Minimize custom window



Sk8er9547
07-03-2002, 07:56 PM
Hi, i have a pop-up window that doesnt have any of the browser borders or anything. I was wondering if there was a simple code to have a link make the window minimize, such as:

<a href="javascript:top.window.minimize()">minimize window</a>

the above code does not work, and i was wondering if i was wrong....thanks for all of your help!

requestcode
07-03-2002, 08:01 PM
With JavaScript you can't minimize a window. All you can do is remove focus from it which would place it behind the main window. Trh this:
<A HREF="javascript:window.blur()">Minimize Window</A>

The blur() method removes focus.

A1ien51
07-04-2002, 04:42 AM
you can do this.....

window.resizeTo(100,100);
window.moveTo(3000,3000);
self.blur();

glenngv
07-04-2002, 06:03 AM
cool! but in Netscape, it doesn't allow window to be positioned out of the desktop area, maybe it's a security issue.


Originally posted by A1ien51
you can do this.....

window.resizeTo(100,100);
window.moveTo(3000,3000);
self.blur();

A1ien51
07-04-2002, 06:19 AM
I personally would do this:



window.resizeTo(100,100);
if(document.all){window.moveTo(3000,3000);}
else{window.moveTo(0,0);}
self.blur();


:thumbsup:A1ien51 :thumbsup:

glenngv
07-04-2002, 06:45 AM
so it's not "minimize" anymore for NS?


Originally posted by A1ien51
I personally would do this:



window.resizeTo(100,100);
if(document.all){window.moveTo(3000,3000);}
else{window.moveTo(0,0);}
self.blur();


:thumbsup:A1ien51 :thumbsup:

A1ien51
07-04-2002, 07:22 AM
It will not hide it, but will just move it off to the side to keep the error from happening

glenngv
07-04-2002, 07:41 AM
so it's better if the code is this:

if(document.all){
window.resizeTo(100,100);
window.moveTo(3000,3000);
self.blur();
}
else{
alert("Sorry, IE feature only.");
}

A1ien51
07-04-2002, 08:20 AM
I wouldn't want to see an alert, I would do it the way I did it.
You could also get a signed script for netscape to move it off of the screen or make it smaller. Look at netscapes website on programming for that

Sk8er9547
07-04-2002, 08:31 AM
Thanks for everything guys! Now i have a problem with moving the window. I want to be able to move the custom window around to any position using click and drag, just like you could in a normal web browser. Any ideas?

A1ien51
07-04-2002, 08:46 AM
LOL....expecting me to give all of my secrets away......??

Right now I have developed a fully functional window which you are trying to do.......but the code is 2hrs away, so I can not finish it...ugh......Oh welll.....

look on Dynamic Drive, they have a window like you want.....

Mine will be posted on my site sometime this weekend I hope....

Send me an email at A1ien51@hotmail.com and I will send you an email telling you when I put it online.

A1ien51



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum