Saturday, May 24, 2025
HomejQuerySpotlight Matching Content material As The Person Varieties - jQuery filteringHighlight

Spotlight Matching Content material As The Person Varieties – jQuery filteringHighlight


A jQuery Plugin to focus on and spotlight matching key phrase phrases because the person is typing in a search discipline.

It is particularly helpful for filtering gadgets in lengthy lists like a buying checklist, homework, or a doc with a whole bunch of phrases.

Easy methods to use it:

1. Obtain and insert the filteringHighlight.js into the doc.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to//FilteringHighlight.js"></script>

2. Create a ‘Filter’ enter on the web page.

<enter id="filter" placeholder="Kind to focus on" />

3. Allow the filter enter to filter & spotlight matching key phrase phrases discovered inside a protracted checklist.

<ul id="root_tree">
  <li><a href="#"><sturdy>Residence</sturdy></a>
    <ol>
      <li><a href="#">Airdrie eNewsletters </a></li>
      <li><a href="#">Airdrie Directories</a></li>
      <li><a href="#">Airdrie Life Video</a></li>
    </ol>
  </li>
  ...
</ul>
$(operate() {
  // filteringHighlight(rootElement, highlightClass, timeout)
  $('#filter').filteringHighlight('#root_tree', 'filteringHighlight', 300);
});

4. Apply CSS types to highlighted characters.

.filteringHighlight {
  background-color: yellow;
}

This superior jQuery plugin is developed by hnvcam. For extra Superior Usages, please test the demo web page or go to the official web site.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments