Enable jump to match and highlight within document |
![]() ![]() ![]() |
You can setup highlighting to occur on the actual page of your website when you click on a search result. However, this requires you to add some Javascript to each page of your site where you want this feature to take effect. It will highlight the word that the user was looking for in the search engine, as well as scroll the window down to the first appearance of the word.
First, you must enable this option in the Configuration window (under the “Results Layout” tab). Once you have enabled this option and re-indexed your website, you must locate the "highlight.js" file included with Zoom. This file can be found in the "extras" folder, which you can access from Zoom Indexer, by clicking on "Tools" in the menu and selecting the option to "Open 'Extras' folder" (also see "Where is the Program Data directory?"). Copy the "highlight.js" file from the "extras" folder to your website files, as you will need to link to the "highlight.js" file from each page of your site that requires the feature. For example, you could paste the following HTML in your site’s header or footer: <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 relative to the page. You will then need to modify the BODY tag on your page to include an "onLoad" attribute, such as: <body onload="highlight();">
If for some reason you can not modify the body tag of your page, an alternative would be to put the following line after the </body> tag of your page: <script type="text/javascript">highlight();</script> |