“晚风吹人醒 万事藏于心 
        我没说不公平 也没说苦 我说我知道了”

 

jq部分

$(function(){
        $(".xuan").each(function(){
            var a = $(this).next().nextAll()
            var sign = 1;
            for (var i = a.length - 1; i >= 0; i--) {
                if(a[i].checked==false){
                    var sign = 0;
                }
            }
            if (sign==0) {
                $(this).next().prop("checked","");
            }else{
                $(this).next().prop("checked","checked");
            }
          });
    })
    $(".xuan_inp").each(function(){
        $(this).nextAll().click(function(){
            var a = $(this).parent().children(":eq(1)").nextAll()
            var sign = 1;
            for (var i = a.length - 1; i >= 0; i--) {
                if(a[i].checked==false){
                    var sign = 0;
                }
            }
            if (sign==0) {
                $(this).parent().children(":eq(1)").prop("checked","");
            }else{
                $(this).parent().children(":eq(1)").prop("checked","checked");
            }
        })
        
    });
    $(".xuan_inp").click(function(){
        var a = $(this).attr("checked");
        if (a=="checked") {
            $(this).nextAll().prop("checked","checked");
        }else{
            $(this).nextAll().prop("checked","");
        }
    })

 

posted on 2020-06-16 13:43  诗里刻画的影子  阅读(132)  评论(0编辑  收藏  举报