Moves the current window by a specified amount.
window.moveBy(deltaX, deltaY)
deltaX
is the amount of pixels to move the window horizontally.deltaY
is the amount of pixels to move the window vertically.function budge() { moveBy(10, -10); }
You can use negative numbers as parameters for this function. This function makes a relative move while window.moveTo
makes an absolute move.
Since Firefox 7, it's no longer possible for a web site to move a window in a browser, according to the following rules:
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'window.moveBy()' in that specification. | Working Draft |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | ? | Yes | ? | ? | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | ? | Yes | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/window/moveBy