Thursday, April 25, 2024
 Popular · Latest · Hot · Upcoming
43
rated 0 times [  47] [ 4]  / answers: 1 / hits: 43928  / 16 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

 Answers
There are no answers for this question yet.
Only authorized users can answer the question. Please sign in first, or register a free account.
irvingjamieb

Total Points: 743
Total Questions: 113
Total Answers: 128

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
irvingjamieb questions
;