<script type="text/javascript">
function show_coords(event)
{
x=event.clientX
y=event.clientY
alert("X coords: " + x + ", Y coords: " + y)
}
</script>
<body onmousedown="show_coords(event)">
But I want to know where inside a div block the user is clicking. The top left of the div block will be 0, 0 and scrolling the page won't make any difference.
Any ideas?
Last edited by Grim... on Wed Feb 15, 2006 4:53 am, edited 2 times in total.
But without setiing the position explicitly I'm not sure it's possible. I seem to remember something about determing the page offset of a node but I can't find any documentation in it so I may be wrong.
Not with that script I just posted no. The cursor positions are based upon the screen (well, in reality it's just the bit of screen that the browser window occupies).