views:

92

answers:

2

Can the browser feature of contrl+F to find text be integrated with text in popup windows.

I'd like to have some scientific reference information given when someone hovers over a species name in a web page. Generating the popup, tooltip style text is no problem, the problem is that anyone using Ctrl+F won't be able to find it, or if I position the text out of view when not required, it will be found but be invisible.

The same sort of effect applies to "accordion" style expanding text areas.

I'm looking for some sort of event generated when find is highlighting a result.

+1  A: 

Unfortunately there is no such event, you can't interfere with the built-in find.

About the best you can do in this case is to provide your own search function in-page, which searches the DOM for Text nodes containing the given text, highlights them, and opens up any closed accordions they're in.

bobince
A: 

The only idea I have, is to put all the text from your popups in one additional scrollbox (maybe at the bottom of the page) with a height just large enough to display one set of detail information at a time. This way, it doesn't take up too much space on the page, and the text can still be found using Ctrl-F.

Chris Lercher
Thank you, that's helped me think about my problem. I can see various solutions now.One thing that might be assumed about browser find is that the browser will scroll the window so that the current find result is visible.I did a quick test on a div whose contents are bigger than its visible area and that was nicely scrolled by find in IE - but not by FF.
David Pilling
ps - Chrome and Safari scroll the div too.
David Pilling