Bootstrap 3 - Switch Large
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.css">
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<link rel="stylesheet" href="http://www.bootstrap-switch.org/dist/css/bootstrap3/bootstrap-switch.css">
<script src="http://www.bootstrap-switch.org/dist/js/bootstrap-switch.js"></script>
<div>
<p class="reset">____RESET_____</p>
<input name="test" class="fs-switch-indeterminate" type="checkbox"
data-size="large"
data-indeterminate="true"
data-on-text="Yes"
data-off-text="No" />
</div>
JavaScript
function initializeSwitch(selector) {
$(selector).bootstrapSwitch('destroy', true);
$(selector).bootstrapSwitch({
'state': null
});
$(selector).on('switchChange.bootstrapSwitch', function(event, state) {
console.log('change event' + (new Date()).getTime());
});
}
$(function() {
initializeSwitch('input[name=test]');
$('.reset').click(function() {
initializeSwitch('input[name=test]');
});
});