Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dlanileonardo/jquery-live-search
A simple, lightweight jQuery plugin for implement live-search.
https://github.com/dlanileonardo/jquery-live-search
Last synced: 3 months ago
JSON representation
A simple, lightweight jQuery plugin for implement live-search.
- Host: GitHub
- URL: https://github.com/dlanileonardo/jquery-live-search
- Owner: dlanileonardo
- License: mit
- Created: 2013-08-18T07:17:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-04-20T20:41:52.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T15:57:27.147Z (4 months ago)
- Language: JavaScript
- Homepage: http://dlanileonardo.github.io/jquery-live-search
- Size: 117 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
jquery-live-search [![Build Status](https://travis-ci.org/dlanileonardo/jquery-live-search.png?branch=master)](https://travis-ci.org/dlanileonardo/jquery-live-search)
==================Description:
------------
A simple, lightweight jQuery plugin for implement live-search.Requirements:
------------### Simple Usage
```js
$.liveSearch({
selectorContainer: "ul",
selectorElementsToSearch: "li",
attributeToSearch: false,
selectorInputSearch: "#search-query",
selectorToHide: false,
selectorFixed: "li:first",
});
```#### HTML
```html
- Header
- Pernalonga
- Patolino
- Eufrazino
- Lola Bunny
- Frajola
- Piu-Piu
- Taz
```
### Ajax Usage
```js
var objLiveSearch = $.liveSearch({
selectorContainer: "ul",
selectorElementsToSearch: "li",
attributeToSearch: false,
selectorInputSearch: "#search-query",
selectorToHide: "li",
selectorFixed: "li:first",
ajaxCallback: function(){
$.get("helpers/ajax-content.html", function(data){
var search_query = objLiveSearch.getInputSearchVal();
objLiveSearch.ajaxDone(data, search_query);
}, 'html');
},
});
```
#### HTML
```html
- Header
```
#### HTML Ajax Return:
```html
Ajax Content
- Header
- Pernalonga
- Patolino
- Eufrazino
- Lola Bunny
- Frajola
- Piu-Piu
- Taz
```
## Options
Option Name
Description
Type
Default Value
attributeToSearch
Name of the attribute that contains the content to be searched
string
data-search
selectorContainer
Main container of elements
string
table
selectorElementsToSearch
Selector of elements to be searched
string
td
selectorInputSearch
Selector of input field search
string
input#search_query
selectorHead
Selector of the Heads
string
false
selectorToHide
Selector element to be hidden
string
false
minCharacters
Minimum number of characters to trigger the search.
integer
3
typeDelay
Delay time at the end of typing.
integer
500
ajaxFilter
Pass false if Ajax return already filtred.
boolean
true
ajaxCallback
Callback function to custom ajax.
callback
false
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/dlanileonardo/jquery-live-search/trend.png)](https://bitdeli.com/free "Bitdeli Badge")