Discussion:
HTML Help + search woes
(too old to reply)
James Hurrell
2009-06-05 18:05:17 UTC
Permalink
I maintain a set of CHM files for a company and recently I was asked to
implement some collapsible sections in various HTML pages to make it
easier to read - the page has a lot of text on it and creating a few
collapsible subsections helps break it up.

To do this, I've used a simple .js file and by default all sections are
collapsed when the page is first opened. It all works fine, apart from
when it comes to using the built in CHM search function. If a search
string is identified within a collapsed section, the CHM will correctly
flag that the page contains the string, but it will not highlight the
string - which is kind of annoying. If the search string is outside a
collapsible section, then it is highlighted correctly.

Does anyone have a workaround for this? Maybe the .js I'm using isn't
great... Short of forcing the collapsible sections to be pre-expanded
when a page is opened, I can't think of anything else I could do. Any
help much appreciated.
Rob Chandler [MVP]
2009-06-06 16:26:18 UTC
Permalink
Hi James
Interesting problem. Looks like you found the downside of using Expando
sections.
I also notice that even in a standard HTML (IE and FF3), search can't even
find
text unless the section is expanded. So in HTML Help pages I guess Ctrl+F
find
has the same limitation.

I think all you can do is document the problem for the user. Or change to
Expanded
by default.

Here's an idea from left field... If your pages kicked off a timer onload
... So the sections
are initially open and then 300 milli seconds later you close all the
sections... I wonder
if that would be enough time for search to highlight correctly. Depends on
how far
you want to go to workaround the problem.

Cheers
Rob
http://helpware.net/FAR/
Post by James Hurrell
I maintain a set of CHM files for a company and recently I was asked to
implement some collapsible sections in various HTML pages to make it easier
to read - the page has a lot of text on it and creating a few collapsible
subsections helps break it up.
To do this, I've used a simple .js file and by default all sections are
collapsed when the page is first opened. It all works fine, apart from
when it comes to using the built in CHM search function. If a search
string is identified within a collapsed section, the CHM will correctly
flag that the page contains the string, but it will not highlight the
string - which is kind of annoying. If the search string is outside a
collapsible section, then it is highlighted correctly.
Does anyone have a workaround for this? Maybe the .js I'm using isn't
great... Short of forcing the collapsible sections to be pre-expanded when
a page is opened, I can't think of anything else I could do. Any help much
appreciated.
Loading...