show the last line of a textarea

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

show the last line of a textarea

harry-6
I have a log output field which should scroll down when the text gets
long and scrollbars are visible.

I tried setSelectionRange and related stuff, and it moved the cursor to
the end, but doesn't actually scroll down.

Also I tried setting offsetTop and scrollTop  without success, as expected.

The goal is to make the last line of a textarea visible without
focussing the element.

Anybody knows a way to do this?

Thx in advance!

Harry
_______________________________________________
Mozilla-seamonkey mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-seamonkey
Reply | Threaded
Open this post in threaded view
|

Re: show the last line of a textarea

Martin Honnen-3
Note cross post and followup-to.

harry wrote:

> I have a log output field which should scroll down when the text gets
> long and scrollbars are visible.

> Also I tried setting offsetTop and scrollTop  without success, as expected.

Why as expected?
If you have the textarea element object then
   element.scrollTop = element.scrollHeight;
should scroll the textarea to the end.
If it does not then please tell us exactly which Mozilla version you use
and whether that is an HTML textarea or you are doing some XUL stuff.


--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
Mozilla-seamonkey mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-seamonkey