This is a highly customizable jQuery autocomplete search plugin designed specifically for search forms featuring a standalone input, similar to the ones used by Musixmatch and Melomap.com. One remarkable feature of this plugin is the ability to navigate through search results using the up and down arrow keys on the keyboard, facilitating result selection via keyboard input. This plugin is ideal for developing a standalone search engine with autocomplete functionality and an aesthetically pleasing user interface that includes images. The design is fully adaptable, allowing you to create a visually stunning layout according to your preferences.
As you can see in the screenshot, you can customize the UI design by overriding CSS and HTML or by modifying the JavaScript code.
Only jquery is required to use this plugin.
- Include the standalone-auto-complete.min.css file
- Include the jquery file
- Include the standalone-auto-complete.min.js file
- Then follow the instructions below
<form action="url/to/search">
<div class="standlone-search-container">
<div class="standalone-input-holder">
<input type="text" autocomplete="off" name="keyword" class="standlone-input" />
</div>
<div class="standlone-result-container">
</div>
</div>
</form>
$(function(){
$('.standlone-input').standaloneAutoComplete({ url : "url to fetch data from server" });
})
[
{
'url':'http://example.com?id=1',
'image_url':'url/to/image',
'first_title':'Bill Gates',
'second_title':'CEO of Microsoft'
},
{
'url':'http://example.com?id=2',
'image_url':'url/to/image',
'first_title':'Mark Zuckerberg',
'second_title':'CEO of Facebook'
},
{
'url':'http://example.com?id=3',
'image_url':'url/to/image',
'first_title':'Drew Houston',
'second_title':'CEO of Dropbox'
}
]
To filter the data by using keyword entered in the input, catch the keyword with "keyword" field from server using HTTP GET parameter
$keyword = $_GET['keyword'];
public JsonResult GetData(string keyword)
{
if(!String.IsNullOrEmpty(keyword)
{
//continue
}
}
That's it! You are done. Customize the design by overriding the css or use the javascript options below.
That is the setting for the search to start when the limited number of words are enterd. For example, it you set it to 3 and you enter only two words in search box, auto complete will not start working.
This is the url to fetch data from server. This field is essential. Use like in the above example.
This is the css rule for selected item border. Selected item means when you choose item from result found using up or down arrow key on keyboard, current item will be hightlighted with the border. This is the css rule for that border. Note you have to set the full css rule as mentioned in default value.
This is the border css rule for searched item border. Note: set the full css rule.
This is the css rule for border radius for each item.
This is the background color for the search result container and its related.
This is the border radius for result container, its related.
This is the backgorund color for the each found item.