Download
User Rating: 0/5 ( 0 votes)
Plugin jquery.lookingfor searches text in list items (<li>) and hides unmatched items. It works not only for <li>, but with anyone HTML-elements on the page. Any input fields (input, textarea) can be transformed into search filter with jquery.lookingfor.
Source: github.com
1. INCLUDE JS FILES
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="jquery.lookingfor.js"></script>
2. HTML
<input type="search" name="query" />
<ul id="numerals">
<li>First</li>
<li>Second</li>
<li>Third</li>
...
</ul>
3. JAVASCRIPT
jQuery(function($) {
$('#numerals').lookingfor({
input: $('input[name="query"]'),
items: 'li'
});
});
4. OPTIONS
All options are optional.
-
input — selector for input field;
-
items — item's selector, default – 'li';
-
highlight — set true for highlight matched text, default — false;
-
highlightColor — #RRGGBB background color for matched text, default – #FFDE00