scrolling in textarea to selection in FF
- From: "Keith Bentrup" <Keith.Bentrup@xxxxxxxxx>
- Date: 31 May 2006 09:46:50 -0700
Hi all,
I wrote a simple search function to find text in a textarea where not
all the text is visible (ie. the text box displays 10 lines but there
may be more than 1000 lines to search). I can find the text and select
it using the function below, BUT I can't figure out how to have the
textarea automatically scroll to the selection in Firefox. Any ideas or
suggestions?
function search(needle,haystack,start) {
var element = document.getElementById(haystack);
index = element.value.indexOf(needle,start);
element.setSelectionRange(index, index+needle.length);
}
Thanks for any insight,
Keith
.
- Follow-Ups:
- Re: scrolling in textarea to selection in FF
- From: Martin Honnen
- Re: scrolling in textarea to selection in FF
- Prev by Date: Re: AJAX question..
- Next by Date: Re: Accessing pseudo-classes through Javascript (Jscript)
- Previous by thread: AJAX question..
- Next by thread: Re: scrolling in textarea to selection in FF
- Index(es):
Relevant Pages
|