zoukankan      html  css  js  c++  java
  • 全选取消全选

    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","");
            }
        })
  • 相关阅读:
    矩阵乘法优化求斐波那契
    高斯消元
    NOIP201305转圈游戏
    双六问题
    线段上格点的个数
    如何写出优雅的Python代码?
    sock.listen()
    python socket编程
    sc,sockname = sock.accept()
    格式化字符
  • 原文地址:https://www.cnblogs.com/zinging/p/13140516.html
Copyright © 2011-2022 走看看