//判断单选是否有是选中的,如果选中点击就不选中,如果不选中,点击就选中
$("input[type='radio']").on('ifClicked', function (event) {
if ($(this).attr("checked",true)) {
$(this).iCheck('uncheck');
} else {
$(this).iCheck('check');
}
});
或者
$(".ifcheck_radio input[type='radio']").on('ifClicked', function (event) {
if($(this).closest(".iradio_square-blue").attr("class").indexOf("checked")>-1){
$(this).closest(".iradio_square-blue").removeClass("checked");
}else{
$(this).closest(".iradio_square-blue").addClass("checked");
}
});
//表单的全选/全不选
$('.list-content table tr:first-child th:first-child input').on('ifChecked ifUnchecked', function(event) {
if (event.type == 'ifChecked') {
$(".list-content table tr td input").iCheck('check');
} else {
$(".list-content table tr td input").iCheck('uncheck');
}
})