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它正在工作当我和孩子们一起工作它会拖动主要的一个
怎么了?
我在博客上写了这个。 这不是那么直截了当,有点令人困惑,但真的很简单。
http://a.shinynew.me/post/4641524290/jquery-ui-nested-sortables
我写了一个专为嵌套结构设计的拖放脚本检查出来… https://supraniti.github.io/Lean-Mean-Drag-and-Drop/