Hi, folks:
I am trying to implement a search toolset based on "textarea". the
function I am using to highlight the resulting string(txt) is
something like:

    textarea.setSelectionRange(pos, pos+txt.length);
    textarea.focus(); /* seems useless */

Everything is OK except when there are more content in textarea, the
selected text(and the caret) does not get to the center of the
textarea, and I have to use scrollbar to find it by myself. (the IE
alternative seems no such problem)

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??

Many thanks for your help..

Best,
lihao(XC)

Reply via email to