Click to See Complete Forum and Search --> : Maximise browser


swish
01-10-2003, 08:38 PM
Does anyone know how to use javascript to maximise a brower when a user clicks on an image or button? thanks.

swish.

Zach Elfers
01-10-2003, 08:45 PM
There is no command to "maximise" a browser window, but you can change it's size.

<script type="text/JavaScript">
<!--

function resizeIt() {
window.resizeTo(500, 500);
}

//-->
</script>
...
<input type="button" value="Click to Resize Window" onClick="resizeIt();">

swish
01-10-2003, 09:18 PM
ok, well i know of one that works for netscape but i dont want that.,,,

what about a command that will do the same thing but maybe not javascript??

swish
01-10-2003, 09:20 PM
<SCRIPT LANGUAGE="JavaScript">

function Minimize()
{
window.innerWidth = 100;
window.innerHeight = 100;
window.screenX = screen.width;
window.screenY = screen.height;
alwaysLowered = true;
}

function Maximize()
{
window.innerWidth = screen.width;
window.innerHeight = screen.height;
window.screenX = 0;
window.screenY = 0;
alwaysLowered = false;
}
</SCRIPT>

<A HREF="javascript:onClick=Minimize()">Minimize</A>
<A HREF="javascript:onClick=Maximize()">Maximize</A>

swish
01-10-2003, 09:26 PM
oh ok, how stupid, if u can minimize and close there should be a maximize, thnx for ur help anyway.

swish.

swish
01-11-2003, 01:15 AM
<html>
<body>
<script language="JavaScript">
self.moveTo(0,0)
function move_2_0_0()
{
self.moveTo(0,0)
self.resizeTo(screen.width,screen.height)
}
-->
</script>
<a href="javascript:move_2_0_0();">Maximize</a>
</body>
</html>

ShrineDesigns
01-11-2003, 01:21 AM
that will make it full screen; if you don't want to piss off the people who go to your site use:

screen.availWidth and screen.availHeight
instead of screen.width and screen.height

swish
01-11-2003, 03:54 AM
nah thats what i wanted it to do, that code is the actions of a button on my interface