43
rated 0 times
[
47]
[
4]
/ answers: 1 / hits: 43831
/ 15 Years ago, tue, february 10, 2009, 12:00:00
When hovering over a span I would like to get the offsetLeft and offsetTop values so I can make something hover near it. When I do this I get 0 for both values.
What is a better way to tackle this? I am using jQuery.
Assume I am starting with (looped by server-side scripting):
<span onmouseover=hoverNearMe(this.offsetLeft,this.offsetTop);>some username</span><br />
FINAL THOUGHTS:
I'm giving the the answer rep out based on code leverage/DRY.
The longer function you could use over and over in your own js library.
The second short answer however is 100% correct too.
More From » jquery