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);
}
})
}})
}
}

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