相关疑难解决方法(0)

是否有一种聪明的方法来获取jQueryUI中的可排序目标

我正在使用jQuery UI链接多个列表,并允许在不同列表之间拖放项目.

在这种情况receive下,我想获取项目被放入的列表.这ui.item.parent()是正确的方法,还是有一个属性uievent让我直接访问它?


<ul><li>item 1</li></ul>
<ul><li>item 2</li></ul>
Run Code Online (Sandbox Code Playgroud)
$('ul').sortable({
    connectWith: 'ul',
    receive: function(event, ui) {
        var targetList = ui.item.parent();
    }
});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui-sortable

9
推荐指数
2
解决办法
1万
查看次数

标签 统计

jquery ×1

jquery-ui-sortable ×1