26th August 2008 - 3 minutes read time
I really don't know how this would be useful, but it might teach you a couple of things about how to use the browser window functions and properties.
The following function resizes the browser window to nothing and then gradually increases this to full screen in a series of steps, at each step the window is moved so that it is in the middle of the screen. This in effect makes it look like the browser window is zooming in.
function warpSpeedWindow(){
for(i = 0;i < 50;i++){
window.moveTo(screen.availWidth * -(i - 50) / 100, screen.availHeight * -(i - 50) / 100);
window.resizeTo(screen.availWidth * i / 50, screen.availHeight * i / 50);
}
window.moveTo(0,0);
window.resizeTo(screen.availWidth, screen.availHeight);
}
You can call this function on the page load by using the following: