Live Filter Select Box - Download Live Filter For Select Box - jQuery sel_filter.js

Download Live Filter For Select Box – jQuery sel_filter.js

Posted on

This time I will share jQuery Plugin and tutorial about Live Filter For Select Box – jQuery sel_filter.js, hope it will help you in programming stack.

Live Filter Select Box - Download Live Filter For Select Box - jQuery sel_filter.js
File Size: 4.39 KB
Views Total: 2682
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The jQuery sel_filter.js plugin adds an inline search field to the select box that allows the user to filter select options in real-time.

How to use it:

1. Load the jquery.sel_filter.js script after the latest version of jQuery JavaScript library (slim build).

2         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
3         crossorigin="anonymous"></script>
4 <script src="jquery.sel_filter.js"></script>

2. Call the function on the regular select element.

01 <select id="demo">
02   <option>Germany ABUS</option>
03   <option>China AEE</option>
04   <option>Taiwan Aiptek</option>
05   <option>France Alcatel</option>
06   <option>Switzerland Alpa</option>
07   <option>United States Apple</option>
08   <option>United States Arecont Vision</option>
09   ...
10 </select>
1 $(function(){
2  
3   $("#demo").sel_filter();
4  
5 });

3. The example CSS to style & position the live search/filter input. Feel free to customize the search input field with your own CSS styles.

01 .sel_filter {
02   width: 16px;
03   background: url('jquery.sel_filter.png') 100% 50% no-repeat;
04   opacity: 0.4;
05   filter: alpha(opacity=40);
06 }
07  
08 .sel_filter_tb {
09   display: inline;
10   padding: 0px;
11   border-collapse: collapse;
12 }
13  
14 .sel_filter_tb td { padding: 0; }

4. Available plugin options with default values.

01 $("#demo").sel_filter({
02  
03   // width of the search field
04   slide_width : 50,
05  
06   // min number of options
07   min_options: 10,
08  
09   // crops options
10   crop: true
11    
12 });

This awesome jQuery plugin is developed by zolll23. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net