We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE

Our volunteers haven't translated this article into Bahasa Indonesia yet. Join us and help get the job done!
You can also read the article in English (US).


Dynamically resizes window.


window.resizeTo(aWidth, aHeight) 


  • aWidth is an integer representing the new outerWidth in pixels (including scroll bars, title bars, etc).
  • aHeight is an integer value representing the new outerHeight in pixels (including scroll bars, title bars, etc).


// function resizes the window to take up one quarter
// of the available screen.
function quarter() {
    window.screen.availWidth / 2,
    window.screen.availHeight / 2


Since Firefox 7, it's no longer possible for a web site to change the default size of a window in a browser, according to the following rules:

  1. You can't resize a window or tab that wasn’t created by window.open.
  2. You can't resize a window or tab when it’s in a window with more than one tab.

See also window.resizeBy.


Specification Status Comment
CSS Object Model (CSSOM) View Module
The definition of 'window.resizeTo()' in that specification.
Working Draft

Tag Dokumen dan Kontributor

 Terakhir diperbarui oleh: cvrebert,