Tag: 嵌套列表

jQuery在父li中单击div时显示嵌套的ul

我试图获得一个隐藏的嵌套ul来显示当它的父li中的div被点击时,并且我有一段时间了。 原样,嵌套的ul的初始隐藏工作,div背景图像切换正常,但没有其他工作。 有什么建议? 目前的代码如下: HTML: 1 a b i ii iii c 2 3 a b c 相关CSS: .buttonShow { display: inline-block; background: url(“../assets/images/plus.png”) no-repeat scroll top left; width: 9px; height: 9px; } .buttonHide { display: inline-block; background: url(“../assets/images/minus.png”) no-repeat scroll top left; width: 9px; height: 9px; } jQuery的: $(document).ready(function(){ $(‘.subField’).hide(); $(‘.buttonShow’).click(function() { $(this).toggleClass(‘buttonHide’); $(this).parent().next(‘.subField’).show(‘slow’); […]

jquery嵌套可排序列表

我有这个代码 $(document).ready(function() { $(“#test-list”).sortable({ items: “> li”, handle : ‘.handle’, axis: ‘y’, opacity: 0.6, update : function () { var order = $(‘#test-list’).sortable(‘serialize’); $(“#info”).load(“process-sortable.asp?”+order+”&id=catid&order=orderid&table=tblCats”); } }); $(“#test-sub”).sortable({ containment: “ul”, items: “li”, handle : ‘.handle’, axis: ‘y’, opacity: 0.6, update : function () { var order = $(‘#test-list’).sortable(‘serialize’); $(“#info”).load(“process-sortable.asp?”+order+”&id=catid&order=orderid&table=tblCats”); } }); }); 对于这种UL 但是它可以动态地改变…当我拖放主要的li它正在工作当我和孩子们一起工作它会拖动主要的一个 怎么了?