Find Line Above or Below in Javascript

Posted by Dark Falcon on Stack Overflow See other posts from Stack Overflow or by Dark Falcon
Published on 2010-03-15T21:56:00Z Indexed on 2010/03/15 21:59 UTC
Read the original article Hit count: 348

Filed under:
|

I am working on an in-place HTML editor, concentrating on Firefox only right now. I have an element inserted where the cursor should be and also have left and right arrows working, but I can't seem to find a way to find:

  1. Start and end of a line for the home and end keys
  2. The next line up or down for the up/down arrows.

I see document.elementFromPoint, but this doesn't get me a Range object. The Range object itself seems rather useless when it comes to using pixel positions.

© Stack Overflow or respective owner

Related posts about firefox

Related posts about JavaScript