Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albburtsev/jquery.lookingfor
Fast search as you type jQuery-plugin
https://github.com/albburtsev/jquery.lookingfor
Last synced: 18 days ago
JSON representation
Fast search as you type jQuery-plugin
- Host: GitHub
- URL: https://github.com/albburtsev/jquery.lookingfor
- Owner: albburtsev
- License: mit
- Created: 2014-01-20T18:34:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-19T19:52:16.000Z (over 9 years ago)
- Last Synced: 2024-09-15T10:07:30.598Z (about 2 months ago)
- Language: JavaScript
- Homepage: http://albburtsev.github.io/jquery.lookingfor/
- Size: 571 KB
- Stars: 56
- Watchers: 5
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jquery.lookingfor
=================![Screenshot](https://rawgithub.com/albburtsev/jquery.lookingfor/master/screenshots/highlight.png)
Fast search as you type jQuery plugin.
It's very small (minified — 2.5kb, gzipped — 1.2kb), very fast and supports old browsers (IE6+).
__jquery.lookingfor__ plugin searches text in list items (```
It works not only for `
Any input field (```input, textarea```) can be transformed to search filter with __jquery.lookingfor__.
[Live demo](http://albburtsev.github.io/jquery.lookingfor/)
## Install
Download latest [release](https://github.com/albburtsev/jquery.lookingfor/releases).
Use [minified](https://github.com/albburtsev/jquery.lookingfor/blob/master/jquery.lookingfor.min.js)
or [development](https://github.com/albburtsev/jquery.lookingfor/blob/master/jquery.lookingfor.js) version.
Or use [bower](http://bower.io/) for install:
```
bower install jquery.lookingfor --save
```
## Usage
Include [jQuery](http://jquery.com) and __jquery.lookingfor__ on your page:
```html
```
Prepare list of items for following search and an input field (optional):
```html
- First
- Second
- Third
...
```
Call ```lookingfor()``` method with necessary options:
```js
jQuery(function($) {
$('#numerals').lookingfor({
input: $('input[name="query"]'),
items: 'li'
});
});
```
### Options
All options are optional.
* __input__ — input field's selector;
* __items__ — item's selector, default – ```'li'```;
* __highlight__ — set ```true``` to highlight matched text, default — ```false```;
* __highlightColor__ — ```#RRGGBB``` background color for matched text, default – ```#FFDE00```;
* __onFound {Function(HTMLElement item, String query)}__ — callback, will be called when text is found.