Name

screenX, screenY — NN 4 IE 4 DOM n/a

Synopsis

Read-only

Horizontal and vertical pixel coordinate points where the cursor was located on the video screen when the event occurred. The top-left corner of the screen is point 0,0. There is no particular coordination with the browser window, unless you have positioned the window and know where the active window area is in relation to the screen.

Example

// NN
if (evtObj.screenX < 5 || evtObj.screenY < 5) {
    alert("You\'re too close to the edge!")
}
// IE
if (event.screenX < 5 || event.screenY < 5) {
    alert("You\'re too close to the edge!")
}

Value

Any positive integer or zero.

Default

None.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.