mozilla
Your Search Results

    Window.moveBy()

    Summary

    Moves the current window by a specified amount.

    Syntax

    window.moveBy(deltaX, deltaY) 
    

    Parameters

    • deltaX is the amount of pixels to move the window horizontally.
    • deltaY is the amount of pixels to move the window vertically.

    Example

    function budge() {
      moveBy(10, -10);
    }

    Notes

    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:

    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

    DOM Level 0. Not part of any standard.

    See also

    Document Tags and Contributors

    Contributors to this page: Sheppy, fscholz, LibreGeekingKid, ethertank, teoli, JesseW, Mgjbot, Dria
    Last updated by: teoli,
    Hide Sidebar