PDA

View Full Version : Returning screen coordinates


PHP_NewGuy
10-04-2004, 03:45 PM
Hi All,
Is it possible to return the screen coordinates of the user's mouse click on an image?

I know that you could position a series of image maps in a grid fashion across the image to find the coordinates, but is there an easier way?

Jon Hanlon
10-04-2004, 07:06 PM
Unfortunately the event object is browser specific.
See Microsoft's at:
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/obj_event.asp


function findXY() {
status=event.clientX + ',' + event.clientY + ' ' + event.x + ',' + event.y + ' '
+ document.body.clientHeight + ',' + document.body.clientTop
}
window.document.ondblclick = findXY;