Search.../

screenX

Gets the distance in pixels between the pointer and the left edge of the screen or screens.

Description

The screen refers to the physical screen or screens. Therefore, two clicks on the same physical point of the screen return the same screenX values even if the page is scrolled horizontally in the meantime. But two clicks on the same point on the page return different screenX values if the page is scrolled horizontally in the meantime.

Coodinate Reference

Type:

numberRead Only

Was this helpful?

Get a mouse click's coordinates

Copy Code
1$w("#myElement").onClick( (event) => {
2 let clientX = event.clientX; // 362
3 let clientY = event.clientY; // 244
4 let offsetX = event.offsetX; // 10
5 let offsetY = event.offsetY; // 12
6 let pageX = event.pageX; // 362
7 let pageY = event.pageY; // 376
8 let screenX = event.screenX; // 3897
9 let screenY = event.screenY; // 362
10} );