|
CodeAve.com - JavaScript - Misc | |||
|
|
|||
| Move and Resize the Browser Window | ||||
|
|
||||
<html> <title>CodeAve.com(Move and Resize Window)</title> <body bgcolor="#FFFFFF"> <script language="JavaScript"> <!-- // This will move the window when it is opened or // refresh/reload is clicked to a location zero pixels to the left // and zero pixels from the top. Left command goes first, // top to bottom comes after self.moveTo(0,0) // This will resize the window when it is opened or // refresh/reload is clicked to a width and height of 500 x 500 // with is placed first, height is placed second self.resizeTo(500,500) --> </script> When the window is opened or refresh/reload are clicked <br>the window will move to zero from the left and zero from the top <br>and set a browser window width and height of 500 x 500 <script language="JavaScript"> <!-- // function to allow the moving of the window location by link // to a location of 400 pixels from the left and 300 pixels from the top function move_2_400_300() { self.moveTo(400,300) self.resizeTo(400,300) } --> </script> <br> Click <a href="javascript:move_2_400_300();">here</a> to move the window to 400 pixels from the left and 300 pixels from the top <br>and set a browser window width and height of 400 x 300 <script language="JavaScript"> <!-- // function to allow the moving of the window location by link // to a location of 1/2 the screen from the left // and 1/2 the screen from the top function move_2_half_half() { self.moveTo(screen.width/2,screen.height/2) self.resizeTo(screen.width/2,screen.height/2) } --> </script> <br> Click <a href="javascript:move_2_half_half();">here</a> to move the window to 1/2 way from the left and 1/2 way from the top <br>and set a browser window width and height of 1/2 of their maximum size <script language="JavaScript"> <!-- // This function will move the window when when clicked // to a location zero pixels to the left and zero pixels from the top. self.moveTo(0,0) function move_2_0_0() { self.moveTo(0,0) self.resizeTo(screen.width,screen.height) } --> </script> <br> Click <a href="javascript:move_2_0_0();">here</a> to move the window to zero pixels from the left and zero pixels from the top <br>and set a browser window width and height to their maximum size </body> </html>
|
||||
|
|
||||