TOC PREV NEXT INDEX

domref



screenX


Returns the horizontal coordinate of the event within the screen as a whole..

Syntax

xCoord = event.screenX
 

Parameters

xCoord is the offset from the left side of the screen in pixels.

Example

function checkClickMap(e) {
 
  if e.screenX < 50
 
    doRedButton();
 
  if 50 <= e.screenX < 100
 
    doYellowButton();
 
  if e.screenX >= 100
 
    doRedButton();
 
}
 

Notes

When you trap events on the window, document, or other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the "clickMap" example demonstrates.

Specification

screenX
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX