Jump to match and highlighting in document

How do I enable Jump to match and highlighting within documents?

This option allows you to have search results which, when you click on the link, will open the document, and scroll to the matched word found. It will also highlight all instances of the words that were found on that document.

Note: This feature only works for HTML web pages, and not Word, XLS and other document types. It also will not work with Javascript disabled browsers.

For highlighting within PDF documents, enable the "Highlight and locate matched words within PDF document viewer" option by double clicking on the ".pdf" extension on the "Scan Options" tab of the Zoom Configuration window. More details here.

First, you will need to enable the option in Zoom. Click on "Configure" in the main window, and select the "Results Layout" tab. Check the "Jump to match and highlight within document" option. You will need to re-index your site.

Locating the highlight script

In V6 of Zoom, you can locate the highlight script in the Zoom "Extras" folder. This can be accessed via a menu item in the Zoom Indexer.

Simply click on "Tools"->"Open 'Extras' folder" and you will find the "highlight.js" script available for you to copy and add to your web site.

In older versions of Zoom (V5), the highlight script could be found in the Zoom program folder, which is usually something like: C:\Program Files\Zoom Search Engine 5.0\highlight.js

Note that the V6 script has better compatibility than the V5 script and so should be used in preference to V5 when possible.

Adding the script to your site

Copy the highlight.js file to your website, as you will need to include the "highlight.js" file from each page on your site. Typically, you would have a way to modify the header or footer across all the different pages of your site (for example, by using "Assets" in Dreamweaver). This would be the best place to put the following HTML script link:

<style type="text/css">.highlight { background: #FFFF40; }</style>
<script type="text/javascript" src="highlight.js"></script>

Note that you will need to specify the correct path to "highlight.js" depending on where the file is located. You can also change the "style" line in the above if you wish to modify the appearance of the highlighting. Note: You can omit the "style" line in the above if you already have a "highlight" class defined in the CSS file for that page.

Finally, you will need to modify the BODY tag on your page to include an "onload" attribute, such as:

<body onload="highlight();">

And that's it! If for some reason you can not modify the BODY tag on your page, an alternative would be to put the following line on the very last line of your HTML file (eg: after the </body> tag) so that it can perform the highlighting after the content has been downloaded:

<script type="text/javascript">highlight();</script>

Once you have successfully applied the above changes, you should find that clicking on a search result will now go straight to the word found and all matching words will be highlighted on the page.

Problems? Can't get it to work?

Please see our Troubleshooting page for help and more information on getting the Jump to Highlight script to work.

Return to the Zoom Search Engine Support page.