Monday, March 26, 2012

Detecting point of click on Table

Hi all.
I have a Table on my page. By xml-script I can detect clicks on it.

<components>
<button id="Table1" click="DoSomething" />
</components
But I want to know coordinates of the point on this table, which was clicked. Specifically I want to have them in my function "DoSomething()"
Please, help me.

There are examples here for tracking mouse position:http://www.irt.org/script/pointer.htm

-Damien


DoSomething should be a function like so:

function DoSomethign(ev){}

ev.clientX and ev.clientY will give you the coordinates, and so on.

No comments:

Post a Comment