Name

Window.resizeTo( ): resize a window — JavaScript 1.2:

Synopsis

window.resizeTo(width, height)

Arguments

width

The desired width for the window.

height

The desired height for the window.

Description

resizeTo( ) resizes window so it is width pixels wide and height pixels high. For security reasons, the browser may restrict this method to prevent scripts from making windows very small. For usability reasons, it is almost always a bad idea to change the size of a user’s window. If a script created a window, the script can resize it, but it is bad form for a script to resize the window that it is loaded into.

Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.