Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Test"
Bootstrap 4.1.1 Snippet by
R3CKL3Z
4.1.1
jQuery
Preview
HTML
JS
View Full Screen
Fork
Fork this
411
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <h3>Head Admin permissions<br /> <small>Reports</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Toxicity</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Abusive kick</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Hacking</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Griefing</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Smurf</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Server issues</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Boosting</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaderboard abuse</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Offensive language</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaver</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Throwing</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <h3> <small>Pages</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Home</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Classical</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Legends</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Second Chance</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Search </button> <input type="checkbox" class="hidden" checked /> </span> <hr /> </div> <div class="container"> <h3>Admin permissions<br /> <small>Reports</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Toxicity</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Abusive kick</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Hacking</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Griefing</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Smurf</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Server issues</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Boosting</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaderboard abuse</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Offensive language</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaver</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Throwing</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <h3> <small>Pages</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Home</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Classical</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Legends</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Second Chance</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Search </button> <input type="checkbox" class="hidden" checked /> </span> <hr /> </div> <div class="container"> <h3>Senior moderator<br /> <small>Reports</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Toxicity</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Abusive kick</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Hacking</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Griefing</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Smurf</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Server issues</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Boosting</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaderboard abuse</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Offensive language</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaver</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Throwing</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <h3> <small>Pages</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Home</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Classical</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Legends</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Second Chance</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Search </button> <input type="checkbox" class="hidden" checked /> </span> <hr /> </div> <div class="container"> <h3>Moderator<br /> <small>Reports</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Toxicity</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Abusive kick</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Hacking</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Griefing</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Smurf</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Server issues</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Boosting</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaderboard abuse</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Offensive language</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaver</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Throwing</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <h3> <small>Pages</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Home</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Classical</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Legends</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Second Chance</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Search </button> <input type="checkbox" class="hidden" checked /> </span> <hr /> </div> <div class="container"> <h3>Trial moderators<br /> <small>Reports</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Toxicity</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Abusive kick</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Hacking</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Griefing</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Smurf</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Server issues</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Boosting</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaderboard abuse</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Offensive language</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Leaver</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Throwing</button> <input type="checkbox" class="hidden" checked /> </span> <br /> <h3> <small>Pages</small> </h3> <br /> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Home</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Classical</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Legends</button> <input type="checkbox" class="hidden" checked /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Second Chance</button> <input type="checkbox" class="hidden" /> </span> <span class="button-checkbox"> <button type="button" class="btn" data-color="primary">Search </button> <input type="checkbox" class="hidden" checked /> </span> <hr /> </div>
$(function () { $('.button-checkbox').each(function () { // Settings var $widget = $(this), $button = $widget.find('button'), $checkbox = $widget.find('input:checkbox'), color = $button.data('color'), settings = { on: { icon: 'glyphicon glyphicon-check' }, off: { icon: 'glyphicon glyphicon-unchecked' } }; // Event Handlers $button.on('click', function () { $checkbox.prop('checked', !$checkbox.is(':checked')); $checkbox.triggerHandler('change'); updateDisplay(); }); $checkbox.on('change', function () { updateDisplay(); }); // Actions function updateDisplay() { var isChecked = $checkbox.is(':checked'); // Set the button's state $button.data('state', (isChecked) ? "on" : "off"); // Set the button's icon $button.find('.state-icon') .removeClass() .addClass('state-icon ' + settings[$button.data('state')].icon); // Update the button's color if (isChecked) { $button .removeClass('btn-default') .addClass('btn-' + color + ' active'); } else { $button .removeClass('btn-' + color + ' active') .addClass('btn-default'); } } // Initialization function init() { updateDisplay(); // Inject the icon if applicable if ($button.find('.state-icon').length == 0) { $button.prepend('<i class="state-icon ' + settings[$button.data('state')].icon + '"></i> '); } } init(); }); });
Related:
See More
Template
Paper Kit 2 PRO Angular
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76