[Javascript] get <a> position

Paul Novitski paul at juniperwebcraft.com
Tue Dec 26 14:55:09 CST 2006


At 12/22/2006 04:44 AM, Michael Borchers wrote:
>i have a link <a href="#" onmouseover="getPosition(this.id)" id="foo[bar]">
>
>how can i can the position of the link <a> on the screen?


Do you mean the position on the screen or the position on the page?

I often rely on Peter-Paul Koch's scripts:
http://www.quirksmode.org/js/findpos.html

Tangentially, I recommend that you consider removing the JavaScript 
from your HTML and isolating it in external file, both for greater 
compatibility and for greater ease of maintenance in the future.

Regards,
Paul 




More information about the Javascript mailing list