;

PDA

Click to See Complete Forum and Search --> : Javascript - resize function - right scripting?


rugbystud
07-17-2002, 05:24 AM
Is there anything wrong with this javascript to resize the browser window? It doesnt work... http://www.heaveninyourhands.com/smilies/irked.gif

<script language="JavaScript" type="text/JavaScript">
<!--
function resize()
{
for (i=300; i<=490; i+=20)
{
self.resizeTo(700,i);
}
self.resizeTo(700,490);
}
//-->
</script>

Musicman
07-17-2002, 09:10 AM
Hi,

it looks you want a gradual change....
So you need
- the current value as a global var
- a timer that calls a function to add one step

h = 300;
function higher()
{ h += 20;
if(h <= 490)
{ self.resizeTo(700, h);
setTimeout("higher()", 300);
}
}

start the entire process by calling higher() once

Musicman