Count lines in textarea?

Discussion in 'Javascript' started by bwucke@gmail.com, Dec 26, 2005.

  1. Guest

    It seems you can't scroll textarea using JS in Opera. - scrollTop
    ignored. Seems the only way to keep appended content within view is to
    remove enough content from start so that it will all fit. And here we
    come to the tricky part, counting real physical lines occupied by text,
    so we could know if there's still need to trim or not. Considering
    linewraps, tabs, newlines, possibly scalable fonts, possibly scalable
    textarea itself...

    My try at the problem. http://www.kurs.horsesport.pl/inne/testcase.html
    Of course it's broken (otherwise I wouldn't ask). I guess I could add
    support for counting tabs, and given a reliable column count even
    reliably estimate differences coming from word wrap but I'm completely
    stumped when it comes to counting width and height with at least
    moderate reliablity. (I know Opera gets them wrong, any workarounds?)

    Any ideas, suggestions, solutions?
     
    , Dec 26, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Augustus
    Replies:
    1
    Views:
    371
    Ken Schaefer
    Sep 10, 2003
  2. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    344
    Anthony Jones
    Feb 5, 2006
  3. Replies:
    4
    Views:
    308
    mick white
    Jan 30, 2006
  4. Replies:
    1
    Views:
    163
    Thomas 'PointedEars' Lahn
    Mar 18, 2006
  5. Replies:
    1
    Views:
    334
    Bart Van der Donck
    Jul 4, 2007
Loading...

Share This Page