View Full Version : Maximize a Window I Open with a Form Button

08-06-2002, 07:30 PM
I'm opening a new window with a form button (see script below). But the window is small when it opens. Does anyone know how to make the window maximize upon opening? Thanks.

<form name="winform">
<input type="button" class="fButton" value="Email" onClick="NewWin=window.open('email.html','NewWin';)

08-06-2002, 07:45 PM
Well, you can't activate the 'maximized' status of the window per se, but you can have your onClick() event call a function that sizes the window to the user's screen size. There are tutorials/scripts for this all over the place.

08-06-2002, 08:26 PM
Yeah. Great help. The purpose of this forum is for people to get help, not to be told "search for it yourself..." :rolleyes:

Can anyone provide an intelligible answer? :confused:

08-06-2002, 08:43 PM
Fine....if that's how you wanna be about it :D
<script language="javascript" type="text/javascript">

function showMaxWin(nUrl)
var h = screen.availHeight;
var w = screen.availWidth;
var features = "width="+w+", height="+h+",top=0,left=0";


<input type="button" class="fButton" value="Email" onClick="showMaxWin('email.htm')">

08-06-2002, 10:22 PM
I couldn't seem to get it to work properly. I tried a few different solutions I found and they all don't maximize the window properly (to normal maximization) and they mess up my browser.

I can't believe there's no script or tag to maximize a fu(king window. Are we living in the dark ages??????????????????

08-06-2002, 10:34 PM
What browser are you using? I just tested it ok here.

Uhhh, availWidht and availHeight are IE only I think. Change them to just width and height
var h = screen.height;
var w = screen.width;
Or just use the fullscreen attribute, but this may piss users off
window.open(nURL,'NewWin','fullscreen');Sorry, no 'maximize' capability, unless someone can prove me wrong.

08-07-2002, 12:38 AM
Yeah. I really can't believe there's no maximize script. Thanks for the script though. I use IE btw.

08-07-2002, 03:37 AM
put this in your new window page email.html

<script language="javascript">
function autoMax(){
if (document.all) {
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;



08-07-2002, 04:43 AM
Thanks people. I'll give it a try.