Fly with code

Get wet inside ocean of code

0%

Differences between Screen, Client, and Page

Above is the clear comparison between Client Coordinate & Page Coordinate.

Client Coordinate

  • It depends on the current size of your browser.
  • Can get the value by e.clientX and e.clientY.

Page Coordinate

  • It depends on the whole size of your webpage
  • if the webpage length is long, then you might need to scroll your mouse to reach the webpage bottom.
  • Can get the value by e.pageX and e.pageY.

Screen Coordinate

  • It depends on resolution of your screen, for example, your LCD.
  • It has zero connection with your browser, and probably won’t use it when building webpage.
  • Can get the value by e.screenX and e.screenY.