views:

26

answers:

1

Hello,

I've been trying to find this solution for the past few hours, but no luck so far. How could i select some text (actually found that one already, but haven't tested completely yet) in a textarea and force it to scroll to that text? I've tried using scrollTop, but i don't really know how to calculate it properly with the number of lines of the wrapping textarea in mind.

A: 

Hey mate,

Think this would be good for what you're trying to do:

http://flesler.blogspot.com/2007/10/jqueryscrollto.html

Can use it to scroll DOM elements, in this case the text you're selecting.

timothyclifford
Thank you, but i can't use jquery. I was hoping there was some simple function that i missed.
Marius
http://stackoverflow.com/questions/155306/cross-browser-jump-to-scroll-textarea
timothyclifford