• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Moving Windows

You can use the moveBy and moveTo methods to move windows. The moveBy method moves a window by a given (positive or negative) X and Y offset, and the moveTo method moves a window to a specific X and Y location. Both methods take two arguments—the X and Y offset (for moveBy) or new position (for moveTo), measured in pixels.

X and Y coordinates for the moveBy and moveTo methods are measured in screen coordinates, where (0, 0) is the upper-left corner of the screen; positive X is to the right, and positive Y is downward. To move 10 pixels down and 5 pixels to the left, for example, use moveBy(-5, 10). Note that this is true for all JavaScript graphical methods: (0, 0) is at upper left (the upper left of the screen for the moveBy and moveTo methods, but possibly the upper left of other windows—such as the browser window—for certain other methods), positive X is to the right, and positive Y is downward.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint