bootstrap中icheck的使用案例

$(document).ready(function(){

$("input[type='checkbox']:not(.simple)").iCheck({     //这里的simple是指,使用这个的icheck的是内嵌的,使用simple后才能使用代码
 /* handle: 'checkbox' */
/* checkboxClass: 'icheckbox' */
checkboxClass: 'icheckbox_minimal'      //默认样式
});
 //使用ON绑定事件
$("#selectAll").on('ifChecked', function(event){        //如果是选中,点击后则为不选中    
  $("tbody input").iCheck('check');
}); 
$("#selectAll").on('ifUnchecked', function(event){        //如果不选中,点击后则为选中
$("tbody input").iCheck('uncheck');
}); 

});



function del(){
if ($("input[name='errorBox']:checked").length>0) {      
$.confirm("Are You Sure to Delete This?", {ok:function(){
$.post("${path}/arwen/uploadTrack/removeUploadTrack", $("input[name='errorBox']").serialize(), function(result) {      //调用后台方法
if (result.result) {
   window.location.reload(); //重载并刷新
} else {
alert(result.message);
}
})
}})
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章