PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Clearing/removing highlighting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Clearing/removing highlighting

    I am using v5.1, Professional Edition.

    I've implemented the function that allows you to highlight and jump to the search term. It works fine. However, I would like the user to be able to clear/remove the highlights on the page if the user chooses. Is there a way to do this using ZSE or by editing the javascript?

    FYI, I am capable of tweaking javascript, but not capable of writing a script from scratch (well, maybe if it's not too complicated).

    If there is no option in Zoom Search Engine, I was wondering if I could do it with a button that used the reload method, but with some option that reloads only the base address (ex: http://www.mysite.com/webpage.html) instead of the address with the search terms (ex: http://www.mysite.com/webpage.html?zoom_highlight=word). I've been unable to find a way to do it.

    Any ideas would be appreciated.

  • #2
    Yes, this would require some custom scripting as we have no script pre-written to do this.

    There are several possible solutions. As you suggest re-loading the page without the zoom_highlight parameter is one option.

    It is easy enough to include a link back to the base URL, but you really want this link to toggle the highlight on and off. Which is harder.

    I don't think there is a 5min solution. It might take an hour or two even for an experienced coder to come up a workable solution.

    Comment


    • #3
      Another option:

      Use Javascript to dynamically switch between different stylesheets. One of which has the .highlight class specified, and one of which has it specified with out the highlighting colours/appearance.

      There's alot of tutorials online for this method. Google for "javascript switch css" or "switch stylesheets". Some example reference tutorials:
      http://www.davenicolette.net/dhtml/switchstyles.html
      http://www.web-wise-wizard.com/css-s...namically.html
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment


      • #4
        Solution

        Thanks for the help.

        Using InnerHTML, I have a feature on my site that allows the user to 1) highlight individual words, 2) remove the highlight from individual words, and 3) clear all highlights. The "clear" button used to reload the page, which cleared all InnerHTML highlights.

        I've now changed that script from a general reload to a reload of the particular page (without the ZSE highlight info in the address). This clears all highlights (both InnerHTML and those from ZSE). If the user wishes to re-highlight the search term, he can just use the highlight feature on my site.

        The only negative is that the back button sees the address with the ZSE search term info as a separate page. Thus after clearing the highlighting, if you hit the back button the ZSE search terms are highlighted again. No big deal though, this may not even be a bad thing.

        Thanks again.

        Comment

        Working...
        X