This time I will share jQuery Plugin and tutorial about Customizable Checkbox Plugin with jQuery and Bootstrap – simpleBtChecks, hope it will help you in programming stack.
Simple Bt Checks is a simple jQuery plugin used to beautify the default checkboxes using Bootstrap button styles, Glyphicons or your own styles.
How to use it:
1. Load the necessary jQuery library and Bootstrap’s stylesheet in your html document.
1 |
< link rel = "stylesheet" href = "/path/to/bootstrap.min.css" > |
2 |
< script src = "/path/to/jquery.min.js" ></ script > |
2. Load the simpleBtChecks plugin’s stylesheet and JS files in the document.
1 |
< link rel = "stylesheet" href = "css/simple-bt-checks.css" > |
2 |
< script src = "js/simple-bt-checks.js" ></ script > |
3. Call the function on your checkboxes and done. By default, the plugin uses Bootstrap’s default button styles and the glyphicon-ok
icon to replace the default checkbox styles.
1 |
$( 'input[type="checkbox"]' ).simpleBtChecks(); |
4. Change the default styles using the following options.
01 |
$( 'input[type="checkbox"]' ).simpleBtChecks({ |
03 |
buttonClass: "sbc-default" , |
04 |
checkedIcon : '<svg aria-hidden="true" http://www.w3.org/2000/svg">http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg>' , |
08 |
wrapContainer : 'none' , |
5. Available callback functions.
1 |
$( 'input[type="checkbox"]' ).simpleBtChecks({ |
Changelog:
v3.0.7 (2018-07-08)
v3.0.6 (2018-06-07)
- JS & CSS update
- Add more examples
v3.0.3 (2018-05-21)
v3.0.2 (2018-05-13)
- Removed bootstrap option
- Removed size option
- BtnClass option named to buttonClass
- Renamed namespaces ‘sbtc’ to ‘sbc’
- Basic CSS It is better to customize it according to the project
- Check icon to innerHTML svg
- Renamed plugin
- New documentation
- New id for buttons created
This awesome jQuery plugin is developed by joelthorner. For more Advanced Usages, please check the demo page or visit the official website.