YouTip LogoYouTip

Met Win Moveby

# Window moveBy() Method [![Image 8: Window Object Reference](#) Window Object](#) * * * ## Definition and Usage The moveBy() method moves a window relative to its current position by a specified number of pixels. ## Syntax window.moveBy(x,y) * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The moveBy() method is supported by all major browsers. * * * ## Example ## Example Move the window 250 pixels relative to its current position: function openWin(){ myWindow=window.open('','','width=200,height=100'); myWindow.document.write("

This is my window

"); } function moveWin(){ myWindow.moveBy(250,250); myWindow.focus(); }

[Try it yourself Β»](#) * * Window Object](#)
← Prop Nav PlatformMet Win Focus β†’