tags:

views:

19

answers:

2

I am trying to build a web console application at the moment. I have coded all the most major parts of the app, but I still need a way to display the text appropriately once I have brought it into the browser. There will be more text than the box should be displaying at any one time, so there obviously needs to be some sort of scroll. A textarea would look right, as would a normal div which had overflow set to auto or scroll, however I NEED to be able to ensure that the box stays scrolled to the bottom, so that the most recent output is always being displayed. I don't see any DOM methods for a textbox or textarea that allow control of scroll position. Are there such things? Is there any custom textbox type webapp that allows this sort of control?

A: 

This snippet shows how you can scroll a textarea to a specific line in a cross-browser way. Just scrolling to the bottom should be even easier:

http://features.sheep.art.pl/AutoscrolledTextarea

Radomir Dopieralski
Also here http://stackoverflow.com/questions/13362/scrolling-overflowed-divs-with-javascript. I *swear* I searched around a bit and none of this stuff came up right away...
conartist6
A: 

Ah, little more searching gives this: http://stackoverflow.com/questions/642353/dynamically-scrolling-a-textarea. Helpful! I think that should do it.

conartist6