zoukankan      html  css  js  c++  java
  • 层级结构。。很辛苦的思考了好久。。终于明白了。。

    <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>

    节点的练习

  • 相关阅读:
    scanf和cin的返回值
    C++ STL中Map的按Key排序跟按Value排序
    name lookup of 'res' changed for new ISO 'res' scoping
    string中c_str()、data()、copy(p,n)函数的用法
    C中malloc的使用(转)
    codeforces 653B B. Bear and Compressing(dfs)
    codeforces 653A A. Bear and Three Balls(水题)
    hdu-5646 DZY Loves Partition(贪心)
    hdu-5645 DZY Loves Balls(水题)
    codeforces 655D D. Robot Rapping Results Report(拓扑排序+拓扑序记录)
  • 原文地址:https://www.cnblogs.com/Jlasp/p/3777937.html
Copyright © 2011-2022 走看看