quicksearch icon indicating copy to clipboard operation
quicksearch copied to clipboard

Tip: Add text highlighting to quicksearch plugin

Open echteinfachtv opened this issue 12 years ago • 0 comments

If you want your text highlighted, you can use the jQuery Highlight Plugin together with quicksearch.

I am using it like that:

HTML <input type="text" name="search" value="" id="id_search" />

JS

$("#id_search").quicksearch("ul#searchlist li", {
    noResults: '#noresults',
    stripeRows: ['odd', 'even'],
    loader: 'span.loading',
    onBefore: function() { $("ul#searchlist li").unhighlight(); }, // remove former highlighting
    onAfter: function() { 
        if($('#id_search').val()!='') {
            $("ul#searchlist li:visible").highlight( $('#id_search').val() );
        }
    },
});

Hope that helps, quicksearch is a great plugins! Thanks.

Working example at: Mathe Videos www.echteinfach.tv

echteinfachtv avatar Jul 27 '13 19:07 echteinfachtv