开关按钮
<input id="advanced-settings-switch" type="checkbox" class="make-switch" data-on-text="开" data-off-text="关" data-size="small">
事件
$('#advanced-settings-switch').on({
'switchChange.bootstrapSwitch': function(event, state) {
if (state == true){
$("#advanced-settings").show();
}
else{
$("#advanced-settings").hide();
}
}
});
手动设置状态
$('#advanced-settings-switch').bootstrapSwitch('state', true);