469,287 Members | 2,540 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,287 developers. It's quick & easy.

Cursor position in SPAN element

In a HMTL Span element I have a mouseover event which calls a
javascript function. How in this function can I get the cursor position?

Aug 11 '05 #1
2 2408
Who
<ro*******@hotmail.com> asks
In a HMTL Span element I have a mouseover event which calls a
javascript function. How in this function can I get the cursor position?


There are no cursors in normal span elements, only in those with designMode
and ContentEditable magic. You can still get the actual width of the
characters though, for exampel by creating sub-spans and measuring their
size or using text selection ranges. Then compare that to the mouse location
and you will find the currently hovered letter. The return question
therefore is which browsers you target as there are some standardization and
performance issues here.

hth
ivo
Aug 11 '05 #2
How do I get the current mouse location?
I am try target IE and Firefox.

Aug 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Zenobia | last post: by
10 posts views Thread by Danny | last post: by
4 posts views Thread by Sid S. | last post: by
1 post views Thread by Andy Baxter | last post: by
5 posts views Thread by André Hänsel | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.