How can I highlight the line of text that is closest to the mouse?
Posted
by Aaron Digulla
on Stack Overflow
See other posts from Stack Overflow
or by Aaron Digulla
Published on 2010-03-16T17:00:54Z
Indexed on
2010/03/16
17:01 UTC
Read the original article
Hit count: 252
I have a long text and I'd like to offer the user a reading help: The current line should be highlighted. To make it easier, I'll just use the Y coordinate of the mouse (this way, the mouse pointer isn't going to get in the way). I have a big DIV with the id content
which fills the whole width and a small DIV with the class content
for the text (see here for an example).
I'm using jQuery 1.4. How can I highlight the line of text that is closest to the current mouse position?
© Stack Overflow or respective owner