Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Count lines in textarea?

Reply
Thread Tools

Count lines in textarea?

 
 
bwucke@gmail.com
Guest
Posts: n/a
 
      12-26-2005
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?

 
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
Count = Count + 1 Using only std_logic_1164 Doubt efelnavarro09 VHDL 2 01-26-2011 03:49 AM
Count(*) in a Subquery with multiple tables: How does SQL determine which table to generate the Count() from? Kaimuri MCSD 3 12-29-2004 06:38 PM
I am adding a new row to the datagrid dynamically but if i use the Count property of Item it is not showing the count of the new rows being added Praveen Balanagendra via .NET 247 ASP .Net 2 06-06-2004 07:16 AM
Count lines of code in a project Mark ASP .Net 3 05-12-2004 06:12 PM
Count the number of lines in a JEditorPane. Chris Nevill Java 1 02-12-2004 01:19 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