Click to See Complete Forum and Search --> : maximize a window
nickat
February 17th, 2006, 09:49 AM
Hi all,
Can someone show me how to restore a minimized window with javascript.
I have 5 links on my web page. When the user click on a link, a new window(child window) popup. When the user click on another link, only the child window change it content. Totaling of only two windows for as many time as the user would like to click on the links(from the parent window). Now if the user minimize the child window, how can i make the child window restore/maximize when the user click on another link from the parent window.
Thanks,
PeejAvery
February 17th, 2006, 11:18 AM
Does this help you?
<html>
<body>
<script language="JavaScript">
function maxwin(){
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</script>
<input type="button" onclick="maxwin()" value="Maximize">
</body>
</html>
nickat
February 17th, 2006, 12:50 PM
nope, this does not restore the child window when it's minimize.
PeejAvery
February 17th, 2006, 12:55 PM
nope, this does not restore the child window when it's minimize.
Oh, you want to restore it not just make it fill the screen. Sorry, that cannot be done with JavaScript. JavaScript has not true control over window manipulation except for the windows it creates and those are just parameters.
nickat
February 17th, 2006, 01:05 PM
I wonder if it can be done(it does not need to be javascript)...
PeejAvery
February 17th, 2006, 01:41 PM
Well, I don't think you want to go the route you are taking. Let me get straight what you are doing.
1. You have a main window and the links in that window open to a new window.
2. Now if you click 2 links in the main window 2 windows come up and you want only one?
Is this the case? If it is, can you not just set the link target to be the same window?
nickat
February 17th, 2006, 02:02 PM
I know how to display just one pop-up window even if the user click on all the links...my question is if for some reason the user minimize the pop-up window, is there a way where i can restore the minimized window when the user click on any of the link again. Because if the window is minimize, when they click on the link, the user would not be able to see anything change unless they manually restore the minimized window...some of my user are very ____ and would not know that they have minimize the one and only one popup window that they have.
i guess my option now is to disable the minimize button...just wondering if there's an alternative..
PeejAvery
February 17th, 2006, 04:14 PM
i guess my option now is to disable the minimize button...just wondering if there's an alternative..
No, no. I get what you are saying now. The example below will bring the window back into focus if someone has changed focus. I even believe it will make the window restore.
WINDOWNAME.focus();
nickat
February 21st, 2006, 01:15 PM
<script language="JavaScript">
function wopen(url, name, w, h)
{
w += 32;
h += 96;
var win = window.open(url, name,
'width=' + w + ', height=' + h + ', ' +
'location=no, menubar=yes, ' +
'status=no, fullscreen=no, toolbar=yes, scrollbars=yes, resizable=no');
win.focus();
}
</script>
the above code with the win.focus(); did not restore the window for me.
PeejAvery
February 21st, 2006, 03:03 PM
...win.focus(); did not restore the window for me.
I think your only other option then is to create a new window with the focus and close the current one.
degsy
February 22nd, 2006, 07:16 AM
Something like this should work
<script type="text/javascript">
var myWin=0;
function myPopUp(page){
if(myWin){
if(!myWin.closed){
myWin.focus();
}
}
myWin = open(page,'myPopup');
return false;
}
</script>
</head>
<body>
<a href="http://www.google.com" onclick="return myPopUp(this.href)">Link</a><br>
<a href="http://www.yahoo.com" onclick="return myPopUp(this.href)">Link</a>
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.