Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Cursor position in SPAN element

Reply
Thread Tools

Cursor position in SPAN element

 
 
robin9876@hotmail.com
Guest
Posts: n/a
 
      08-11-2005
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?

 
Reply With Quote
 
 
 
 
Who
Guest
Posts: n/a
 
      08-11-2005
<> 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


 
Reply With Quote
 
 
 
 
robin9876@hotmail.com
Guest
Posts: n/a
 
      08-11-2005
How do I get the current mouse location?
I am try target IE and Firefox.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to tell if cursor is sqlite.Cursor or psycopg2.Cursor dmaziuk Python 3 01-25-2011 04:52 AM
Can't code a css class that makes a span element the same size as a button element Cal Who ASP .Net 5 04-26-2010 05:35 PM
I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stéphane Klein Python 2 03-30-2010 12:35 AM
Re: I'm looking for html cleaner. Example : convert <h1><span><font>my title</font></span></h1> => <h1>my title</h1>… Stefan Behnel Python 0 03-29-2010 08:14 PM
Can span include span? Fulio Open HTML 5 06-26-2009 10:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57