On Feb 1, 10:29 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Hi lihao
>
> >Is there any method under Firefox that the caret and the selected text
> >can automatically jump to the center of the textarea so that people
> >dont need to scroll down/up to find it??
>
> Not that I know of, but you could force the scroll with jQuery, if you
> want, this plugin can save you some troubles:
> jQuery.ScrollTo:http://flesler.blogspot.com/2007/10/jqueryscrollto.html
>
> Is the textarea bigger than a regular screen ? ( 600px ? ) If it's
> not, you could just center the screen on the textarea.
> If it's even bigger, then you need some implement some sort of wise
> scrolling, based in the position of the caret

Hi, Ariel:

The textarea is '550px' in my application, so I guess I actually need
to count the 'px' from the top and left of the textarea borders. so I
need to find a way to roughly compute these two numbers by using the
width of the textarea, number of newlines before the current position
and the font-size.. Is there any better approach to do this with
scroll-To within a textarea element?  :-)

Many thanks,
lihao(XC)

Reply via email to