Anyautocomplete

A plugin created for search suggestions that is more flexible

View project on GitHub

AnyAutoComplete

A plugin created for search suggestions that is more flexible.

Why?

Most search suggestion plugins were very strict, didn't allow users to still write naturally while using suggestions, only allowing search suggestions to be at the end of input text, AnyAutoComplete solves this!

Try it out

Enter anything you would like in the area below. If one of these words are in the description above, you'll be assisted by AnyAutoComplete. Pressing tab automatically adds this first word in the suggestion list

Dependencies

  • -jQuery 2.*

Getting Started

Use npm

npm install --save anyautocomplete

Use bower

bower install --save AnyAutoComplete

or Download minified script from GitHub

https://github.com/gggordon/AnyAutoComplete/blob/master/AnyAutoComplete.min.js

Then Include in html file

<script type="text/javascript" src="AnyAutoComplete.min.js"></script>

This plugin works well with bootstrap, otherwise you may include the default stylesheet also from github

<link type="text/css" rel="stylesheet" href="AnyAutoComplete.css" />

Usage

With jQuery

$('.suggestion-boxes').anyAutoComplete(options); 

or standalone

new AnyAutoComplete(divNode, options);

where


divNode - HTMLInputElement  - textbox node
options - Object
=================
options : {
    dataSource : { //keywords or suggestions
        'Cat 1 Name':[
            'Elem 1',
            'Elem 2'
        ],
        'Cat 2 Name':[
            'Elem 1',
            'Elem 2'
        ]
    }
}

Enjoy

Enjoy this project and if you have any issues feel free to state them here on github or contribute.

MIT License