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

Nos bénévoles n'ont pas encore traduit cet article en Français. Inscrivez-vous et aidez-nous à réaliser cette tâche !
Vous pouvez également lire cet article en English (US).


Moves the window to the specified coordinates.


window.moveTo(x, y) 


  • x is the horizontal coordinate to be moved to.
  • y is the vertical coordinate to be moved to.


function origin() {
  // moves to top left corner of screen
  window.moveTo(0, 0);


This function moves the window absolutely while window.moveBy moves the window relative to its current location.

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

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


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

Étiquettes et contributeurs liés au document

 Contributeurs à cette page : cvrebert, fscholz, teoli, cpigat, libreGeekingKid, Sheppy, ethertank, Mgjbot, Dria, JesseW
 Dernière mise à jour par : cvrebert,