It really is as hard as you make it out to be. Unless each line is wrapped in an individual element, the end result will be very hard to achieve. However, what you mentioned may work. If you know that each line is N pixels tall, you can show a line highlight where the mouse cursor is at (mouse_y - (mouse_y % N)).
--John On 3/11/07, Chinmay Kulkarni <[EMAIL PROTECTED]> wrote: > Hi. > > I just cant figure this. I want to highlight the line over which the mouse > is currently hovering. This could be a line in a <p> or a div element. Note > that I don't want to highlight the whole div/p, just the line the mouse is > hovering over. > > An ugly way I *could* do a highlight would be to find the current (active) > element's width, line height, and the mouse position, and add a div at that > point, in a higher layer, and some low alpha value (so the text underneath > can be seen). And this _is_ ugly. The highlight moves with the mouse > (up/down) which is plain crazy. > > Also, obviously, I can't bold/italicize text etc this way. So, any > suggestions? > > -- > Yours, > Chinmay Kulkarni, > www.celbits.org > +91 99820 18699 > _______________________________________________ > jQuery mailing list > [email protected] > http://jquery.com/discuss/ > > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
