OT Javascript scrolling textarea

Randy Jonasz rjonasz-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Nov 22 17:44:37 UTC 2006


On 11/21/06, Randy Jonasz <rjonasz-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> This q is not specific to linux but I know there are quite a few
> people on the list who know javascript really well.  I need to write
> some javascript which will scroll a textarea down to where the caret
> position is.  So far the code I have works for IE but not Firefox.
Well the solution to my problem was too simple.  All I needed to do is call

setTimeout("document.forms[0].txtarea.scrollTop="document.forms[0].txtarea.value.length",0);

after i updated the textarea.  Man there are days when the feeling of
being dumb is matched by behaviour. :)

Cheers,

Randy
-- 
Imagine no possessions
I wonder if you can
No need for greed or hunger
A brotherhood of man
Imagine all the people
Sharing all the world
--John Lennon
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list