CancelImage Upload

How to resize a browser window using JavaScript

Usually the code discussed on this page would be applied to a page that was opened via a target blank anchor tag. Indeed, resizing a normal browser window (instead of a "pop-up" window), may cause your website visitors a certain level of concern.

Resizing the current window however is a simple enough task. All that is required is the function resizeTo() added to the window object:

<html>
<head>
<title>How to resize a browser window using JavaScript</title>
</head>
<body onload="window.resizeTo(400, 400);">

Your content here

</body>
</html>

As you can see this function is nothing to complex. Here a closer look at the function resizeTo():

window.resizeTo(Width in Pixels, Height in Pixels);


Login
Want to leave a comment?

No problem. Just enter your email and password below.


register | home | reminder

myDesignTool Networking • www.mydesigntool.cominfo@mydesigntool.com