How to resize a window in Javascript
Description
The browser window can be resized using the resizeTo()
and resizeBy()
methods.
resizeTo()
expects a new width and height and
resizeBy()
expects the differences in each dimension.
Example
<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">
<!-- w w w. j a va 2s.c om-->
//resize to 100 x 100
window.resizeTo(100, 100);
//resize to 300 x 300
window.resizeTo(300, 300);
//resize to 200 x 150
window.resizeBy(100, 50);
</script>
</body>
</html>