This is my new JQuery plugin for replacing select box. I have tried to implement some cool features which makes it easy to implement and you can play with it as like the native one.
Your suggestions, issues are welcome, so that I can improve this plugin
DEMO
Fork this on GitHub
Implementation:
Step 1: include css and scripts in head section
<link href="customselectbox.css" rel="stylesheet" type="text/css"></link>
<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="customselectbox.js"></script>
Step 2: initialize customselect box
$(document).ready(function(){
$('select').customSelect();
});
Features:
- Support thumbnails within option
- Search option
- Set and Get value with normal JQuery method. No need
to process or query the generated new select box, you can use the ref of
the native select box.
eg:
//set value $('#myselect').val(value); //get value $('#myselect').val();
- Support native reset within the form - i.e) when form gets reset the value of the select box gets reset to its default value
- supported browsers: IE8+, firefox, safari, chrome
- attaching events,
$('select').change(function () { alert('Change Event Fired'); }); $('select').click(function () { alert('Click Event Fired'); });
Comments
Post a Comment