Rabu, 04 Desember 2013

Custom Select for Twitter Bootstrap 3 (Miscellaneous)



What is this?



This is a jQuery plugin extending the functionality of Twitter Bootstrap 3. It allows you to turn a default select input field into an element completely matching the style of Twitter Bootstrap 3 with one line of JavaScript.



Why use it?



  • applies Twitter Bootstrap 3 style to a select input field

  • preserves native select input field behavior (you can use GET or POST methods to submit the selected value)

  • easily styleable

  • by default uses Twitter Bootstrap3 button styling and field sizing classnames, but this can be easily overridden by using custom ones

  • accessible – supports keyboard tabbing very well (gaining and loosing focus)



Easy to use


Example:


<script>
$(document).ready(function(){
$('.some_classname').bootstrapSelect();
});
</script>

Please note: step-by-step explanation is in the docs.



This plugin requires



  • jQuery JavaScript library

  • Twitter Bootstrap 3 front-end framework



Changelog


v 1.0 (20 October 2013)


Restructured plugin and added public methods: get_value, set_value


v 0.4 (14 October 2013)


Custom attributes on initial select element are copied to a generated HTML element


v 0.3 (22 September 2013)


Added javascript ‘change’ event support


v 0.2 (21 September 2013)


Autocomplete prevented on input field, typing and pasting prevented, added a new option – maximum items visible without a scrollbar


v 0.1 (27 August 2013)


Fix: prevented form submit on caret/button click


Initial release (13 August 2013)

Filled Under:

0 komentar:

Posting Komentar