https://github.com/ikcede/jquery-autocomplete
Towards some more customization for autocomplete outputs
https://github.com/ikcede/jquery-autocomplete
Last synced: 10 months ago
JSON representation
Towards some more customization for autocomplete outputs
- Host: GitHub
- URL: https://github.com/ikcede/jquery-autocomplete
- Owner: ikcede
- License: mit
- Created: 2014-02-08T07:01:27.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-03-01T19:01:37.000Z (over 12 years ago)
- Last Synced: 2025-03-06T17:49:07.578Z (over 1 year ago)
- Language: JavaScript
- Size: 133 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jquery-autocomplete
===================
Towards some more customization for autocomplete outputs.
Optimized for Chrome as usual.
Basic usage:
```html
$("#autocomplete").autocomplete();
```
For additional options:
```javascript
$("autocomplete").autocomplete({
data: [], // Array of words to match against
target: $("#"+id+"-area"), // Output div selector
algorithm: "string-match", // Choose which algorithm you want
sorting: "alphabetical", // How the output is sorted
hideTargetIfEmpty: false, // Will hide target if no data recieved
createTarget: true, // Creates target if not existing
displayAllIfEmpty: false // Displays target if empty
});
```
The only available algorithm right now is the "string-match" algorithm.
This algorithm does simple indexOf matching of strings, after converting the input into lowercase.
Only supported sorting right now is alphabetical.
Target is populated like this:
If "autocomplete" is the id of the original element,
```html
- Matched item
- Matched item
```