• 层级结构。。很辛苦的思考了好久。。终于明白了。。


    <script type="text/javascript">
    $(document).ready(function(){
       
           $(".dlei").click(function () {
            if($(this).attr("checked")==true){
                $("."+$(this).attr("id")).fadeIn();//查找子节点显示
            }else{
                $("."+$(this).attr("id")).hide();//查找子节点隐藏
            }
        });
    
        $(".erlei").click(function () {
            if($(this).attr("checked")==true){
                $("."+$(this).attr("id")).fadeIn();
            }else{
                $("."+$(this).attr("id")).hide();
                $("."+$(this).attr("id")+" .sanlei").attr("checked",false);//查找子节点取消勾选
                $("."+$(this).attr("id")+" .siji").attr("checked",false);//查找孙节点取消勾选
            }
        });
        
        $(".sanlei").click(function () {
            if($(this).attr("checked")==true){
                $("."+$(this).attr("id")).fadeIn();
                var sanjizhaoerji=$(this).parent().attr("class");//查找父节点名字
                $("#"+sanjizhaoerji).attr("checked",true);//勾选父节点
                
            }else{
                $("."+$(this).attr("id")).hide();
                $("."+$(this).attr("id")+" .siji").attr("checked",false);//查找子节点。取消勾选
                
            }
        });
    
    });
    </script>
    <span style=" color:#F00"><%=rp("BigClass")%></span>
                        <input name="class1" type="checkbox" class="dlei" id="checkbox_<%=rp("id")%>" value="<%=rp("BigClass")%>"<%if instr(class1,rp("BigClass"))>0 and class1<>"" then %>  checked="checked"<%end if%> /><br />
                        
                        
                <div class="checkbox_<%=rp("id")%>"  style="display:none">
               &nbsp;∟—<span style=" color:#360"><%=rpt("SecClass")%></span>
                <input name="class2" type="checkbox" class="erlei"  id="c_<%=rpt("id")%>" value="<%=rpt("SecClass")%>" <%if instr(class2,rpt("SecClass"))>0 and class2<>"" then %>  checked="checked"<%end if%> /><br />
                
                
                    <div class="c_<%=rpt("id")%>" style="display:none">
                    &nbsp;&nbsp;&nbsp;&nbsp;∟—<span style=" color:#009"><%=rpf("ThiClass")%></span>
                    <input name="class3" class="sanlei" type="checkbox" id="e_<%=rpf("id")%>" value="<%=rpf("ThiClass")%>"<%if instr(class3,rpf("ThiClass"))>0 and class3<>"" then %>  checked="checked"<%end if%>  /><br />
    
                        <div class="e_<%=rpf("id")%>" style="display:none">
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;∟—<span style="color:#300"><%=rpe("FouClass")%></span>
                        <input name="class4" class="siji"  type="checkbox" value="<%=rpe("FouClass")%>" <%if instr(class4,rpe("FouClass"))>0 and class4<>"" then %>  checked="checked"<%end if%> />
                        </div>
                    </div>
                </div>

    节点的练习

  • 相关阅读:
    asp.net membership 修改密码
    linq直接执行sql语句
    word-wrap,word-break,white-space,text-overflow的区别和用法
    ObjectQuery查询及方法
    HTML 标签的 enctype 属性
    【C#学习笔记】类构造函数使用
    【C#学习笔记】播放wav文件
    【C#学习笔记】类型转换
    【C#学习笔记】函数重载
    【C#学习笔记】读文件
  • 原文地址:https://www.cnblogs.com/Jlasp/p/3777937.html
Copyright © 2020-2023  润新知