Compatible lulu ui check with the ie8

var isIE=!!window.ActiveXObject;
var isIE8=isIE&&document.documentMode<9;

$('#checkAll').on("click", function () {
                    if (this.checked) {
                        staffOrgIdList = [];
                        $(this).prop("checked",true);
                        if(isIE8){
                            $(this).next().css("background-position","0px -40px");
                        }
                        $("input[name='ckbs']").each(function () {
                            $(this).prop("checked",true);
                            $(this).parent().parent().addClass('selected');
                            staffOrgIdList.push($(this).attr("val"));
                        });
                    } else {
                        $(this).removeAttr('checked');
                        if(isIE8){
                            $(this).next().css("background-position","0px 0px");
                        }
                        $("input[name='ckbs']").each(function () {
                            $(this).removeAttr('checked');
                            $(this).parent().parent().removeClass('selected');
                            staffOrgIdList = [];
                        });
                    }
                })

Guess you like

Origin www.cnblogs.com/xixicf/p/11613391.html