JavaScript Coordinates

To move elements around we should be familiar with coordinates. Most JavaScript methods deal with one of two coordinate systems:

  • Relative to the window(or another viewport) top/left.
  • Relative to the document top/left.
    It’s important to understand the difference and which type is where.
Dominik Schöler