首页 新闻 论坛 群组 Blog 文档 下载 读书 Tag 网摘 搜索 .NET Java 游戏 视频 人才 外包 培训 数据库 书店 程序员
中国软件网
欢迎您:游客 | 登录 注册 帮助
  • 如何使用jquery实现下级类别折叠功能 [无满意答案结贴]
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-06-26 17:43:48 楼主
    HTML code
    <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableBorder"> <form id="form1" name="form1" method="post" action="sortDel.asp?from=pmemInfoSort"> <tr> <tr> <td colspan="20" class="title"><div align="center">类别列表</div></td> </tr> <tr> <th width="5%" class="title2"><div align="center"></div></th> <th width="10%" class="title2"><div align="center">序号/级别</div></th> <th width="30%" class="title2"><div align="center">完整代码</div></th> <th width="30%" class="title2"><div align="center">名称</div></th> <th width="10%" class="title2"><div align="center">上级分类</div></th> <th width="5%" class="title2"><div align="center">排序</div></th> <th width="5%" class="title2"><div align="center">编辑</div></th> <th width="5%" class="title2"><div align="center">删除</div></th> </tr> <tr onmouseover='this.style.backgroundColor=&quot;#E0EAF5&quot;' onmouseout='this.style.backgroundColor=&quot;&quot;' bgcolor="#F0F4FA" id="marriage" value="marriage"> <td><div align="center"><input name="checkbox" type="checkbox" id="chkbox" value="9" /></div></td> <td><div align="center">1</div></td> <td><div align="center">marriage</div></td> <td><div><a href="pmemInfoSortAddamend.asp?id=9">婚姻状况</a></div></td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?fcode=marriage">添加下级类</a></div></td> <td> <div align="center" onclick="taxis9.disabled=false;taxis9.select();"><input id="taxis9" type="text" value="9" onblur="PublicAjax('taxisAmend.asp?id='+9+'&taxis='+this.value+'&from=pmemInfoSort&ran='+Math.random(),null,'taxis9','GET')" size="6" class="lostfocus" onmouseover='this.className=&quot;getfocus&quot;' onmouseout='this.className=&quot;lostfocus&quot;' disabled="disabled" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/> </div> </td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?id=9">编辑</a></div></td> <td><div align="center"><a href="#" onclick="if(confirm('确认删除吗?'))window.location='sortDel.asp?id=9&from=pmemInfoSort'">删除</a></div></td> </tr> <tr onmouseover='this.style.backgroundColor=&quot;#E0EAF5&quot;' onmouseout='this.style.backgroundColor=&quot;&quot;' bgcolor="#F0F9FA" id="marriage,so"> <td><div align="center"><input name="checkbox" type="checkbox" id="chkbox" value="9" /></div></td> <td><div align="center"></div></td> <td><div align="center">marriage,so</div></td> <td><div><a href="pmemInfoSortAddamend.asp?id=12">丧偶</a></div></td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?fcode=marriage,so">添加下级类</a></div></div></td> <td> <div align="center" onclick="taxis12.disabled=false;taxis12.select();"><input id="taxis12" type="text" value="12" onblur="PublicAjax('taxisAmend.asp?id='+12+'&taxis='+this.value+'&from=pmemInfoSort&ran='+Math.random(),null,'taxis12','GET')" size="6" class="lostfocus" onmouseover='this.className=&quot;getfocus&quot;' onmouseout='this.className=&quot;lostfocus&quot;' disabled="disabled" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/> </div> </td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?id=12">编辑</a></div></td> <td><div align="center"><a href="#" onclick="if(confirm('确认删除吗?'))window.location='sortDel.asp?id=12&from=pmemInfoSort'">删除</a></div></td> </tr> <tr onmouseover='this.style.backgroundColor=&quot;#E0EAF5&quot;' onmouseout='this.style.backgroundColor=&quot;&quot;' bgcolor="#F0F9FA" id="marriage,ly"> <td><div align="center"><input name="checkbox" type="checkbox" id="chkbox" value="9" /></div></td> <td><div align="center"></div></td> <td><div align="center">marriage,ly</div></td> <td><div><a href="pmemInfoSortAddamend.asp?id=11">离异</a></div></td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?fcode=marriage,ly">添加下级类</a></div></div></td> <td> <div align="center" onclick="taxis11.disabled=false;taxis11.select();"><input id="taxis11" type="text" value="11" onblur="PublicAjax('taxisAmend.asp?id='+11+'&taxis='+this.value+'&from=pmemInfoSort&ran='+Math.random(),null,'taxis11','GET')" size="6" class="lostfocus" onmouseover='this.className=&quot;getfocus&quot;' onmouseout='this.className=&quot;lostfocus&quot;' disabled="disabled" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/> </div> </td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?id=11">编辑</a></div></td> <td><div align="center"><a href="#" onclick="if(confirm('确认删除吗?'))window.location='sortDel.asp?id=11&from=pmemInfoSort'">删除</a></div></td> </tr> <tr onmouseover='this.style.backgroundColor=&quot;#E0EAF5&quot;' onmouseout='this.style.backgroundColor=&quot;&quot;' bgcolor="#F0F9FA" id="marriage,wh"> <td><div align="center"><input name="checkbox" type="checkbox" id="chkbox" value="9" /></div></td> <td><div align="center"></div></td> <td><div align="center">marriage,wh</div></td> <td><div><a href="pmemInfoSortAddamend.asp?id=10">未婚</a></div></td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?fcode=marriage,wh">添加下级类</a></div></div></td> <td> <div align="center" onclick="taxis10.disabled=false;taxis10.select();"><input id="taxis10" type="text" value="10" onblur="PublicAjax('taxisAmend.asp?id='+10+'&taxis='+this.value+'&from=pmemInfoSort&ran='+Math.random(),null,'taxis10','GET')" size="6" class="lostfocus" onmouseover='this.className=&quot;getfocus&quot;' onmouseout='this.className=&quot;lostfocus&quot;' disabled="disabled" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/> </div> </td> <td><div align="center"><a href="pmemInfoSortAddamend.asp?id=10">编辑</a></div></td> <td><div align="center"><a href="#" onclick="if(confirm('确认删除吗?'))window.location='sortDel.asp?id=10&from=pmemInfoSort'">删除</a></div></td> </tr>

    js代码如下:
    JScript code
    <script> $(function(){ $("tr").click(function(){ var value=$(this).val(); $("form").each(function(){ $(this).slideUp(); }); }); }); </script>


    婚姻状况是上级类别,下面是未婚等等的二级类别,当然其他类别可能有无限子类别。现在需要点击上级类别让下级类别折叠,请问如何实现?
    40  修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-06-26 17:43:501楼 得分:0
    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【fictioner】截止到2008-06-26 17:43:45的历史汇总数据(不包括此帖):
    发帖数:14                发帖分:310               
    结贴数:14                结贴分:310               
    未结数:0                  未结分:0                 
    结贴率:100.00%            结分率:100.00%           
    敬礼!
    修改 删除 举报 引用 回复
    进入用户个人空间
    加为好友
    发送私信
    在线聊天
    发表于:2008-07-01 16:12:342楼 得分:0
    给个思路就给分
    修改 删除 举报 引用 回复

    网站简介广告服务网站地图帮助联系方式诚聘英才English 问题报告
    北京创新乐知广告有限公司 版权所有 京 ICP 证 070598 号
    世纪乐知(北京)网络技术有限公司 提供技术支持
    Copyright © 2000-2008, CSDN.NET, All Rights Reserved