tags:

views:

26

answers:

3

Hi all,

Is it possible? Get an element by coordinates, without using mouse or other device/resource, just passing top and left parameter like getElementByCoordinates(top,left); ?

Tks,

Manoel

+2  A: 

Call document.elementFromPoint.

SLaks
Thanks, You save my day!
manoelhc
Of course, not all browsers support it...
bobince
A: 

this is what you are looking for : http://api.jquery.com/offset/

jknair
No, it isn't. He's looking for the opposite.
SLaks
+1  A: 

this link:

http://www.roseindia.net/javascript/javascript-elementfrompoint-meth.shtml

should help.

"JavaScript method elementFromPoint returns the presented element at the specified coordinate position given in the arguments."

netrox
it works too. thanks!
manoelhc