window.resizeTo(x,y) and window.resizeBy(xDelta,yDelta)
The browser window can be resized using the resizeTo() and resizeBy() methods. resizeTo() expects a new width and height resizeBy() expects the differences in each dimension.
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">
//resize to 100 x 100
window.resizeTo(100, 100);
//resize to 300 x 300
window.resizeTo(300, 300);
</script>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<script type="text/javascript">
//resize to 200 x 150
window.resizeBy(100, 50);
</script>
</body>
</html>
Home
JavaScript Book
DOM
JavaScript Book
DOM
Window:
- The Window Object
- The Window Events
- window.alert() or alert()
- window.close()
- window.confirm() or confirm()
- window.find() displays find dialog
- window's outer width and height, inner height and width
- window.location
- window.moveBy(distance, distance)
- window.moveTo(x,y) moves the window to the upper-left coordinate
- window.open()
- window.print()
- window.prompt() and prompt()
- window.resizeTo(x,y) and window.resizeBy(xDelta,yDelta)
- window.scrollTo(x,y)
- window.screenLeft, window.screenX, window.screenTop, window.screenY
- window.setInterval() or setInterval()
- window.setTimeout() or setTimeout()
- Pop-up Blockers