Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,基本上,我如何将 jQuery UI 可排序元素与数组链接,以便为每个可排序元素在数组中放置某种索引,并且当它们被移动时,数组会相应地排序?
您可以考虑在元素移动后获取索引列表。
var listOfId = $("#sortable").sortable("toArray");
参考: http ://api.jqueryui.com/sortable/#method-toArray