Email conversation
From | Tim Hughes |
To | Me |
Subject | findinpage how to highlight results at top not bottom |
Date | 21 June 2009 00:25 |
I am using your findinpage js file and would like to know how to have the
item on the page it finds to be highlighted at the top of the page and not
the bottom. For example, on your
http://www.howtocreate.co.uk/jslibs/otherdemo.html#fip page, search for 'How
does this work', the selection is at the bottom, not the top...this is my
page by the way... [URL]
Thank you much,
Tim
From | Me |
To | Tim Hughes |
Subject | Re: findinpage how to highlight results at top not bottom |
Date | 22 June 2009 10:12 |
Tim,
> I am using your findinpage js file and would like to know how to have
> the item on the page it finds to be highlighted at the top of the
> page and not the bottom.
The browser chooses how far to scroll the page when highlighting matches.
Each browser is free to handle it in whatever way that browser decides. The
script has no control over that.
(It may be possible to hack a solution by detecting the position of the
selection range, and scroll the page that far. However, that would be
unreliable if the document has any scrollable containers, and is far beyond
the scope of the script, which simply hooks into the browser's own searching
functionality.)
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Tim Hughes |
To | Me |
Subject | Re: findinpage how to highlight results at top not bottom |
Date | 23 June 2009 00:09 |
Thx for the response....