Javascript jquery连接列表防止在指定列表上删除

Javascript jquery连接列表防止在指定列表上删除,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我已经修改了jquery站点下面的示例连接列表: jQuery UI可排序-连接列表 .connectedSortable{列表样式类型:无;边距:0;填充:0 2.5em;浮点:左;边距右:10px;} .connectedSortable li{margin:0 5px 5px 5px;padding:5px;字体大小:1.2em;宽度:120px;} $(函数(){ $(“.connectedSortable”).sortable({ connectWith:“.connectedSor

我已经修改了jquery站点下面的示例连接列表:


jQuery UI可排序-连接列表
.connectedSortable{列表样式类型:无;边距:0;填充:0 2.5em;浮点:左;边距右:10px;}
.connectedSortable li{margin:0 5px 5px 5px;padding:5px;字体大小:1.2em;宽度:120px;}
$(函数(){
$(“.connectedSortable”).sortable({
connectWith:“.connectedSortable”
}).disableSelection();
});
    第1项 第2项 第3项 第4项 第5项
    第1项 第2项 第3项 第4项 第5项
    第1项 第2项 第3项 第4项 第5项
我需要防止下降到最后一次 或者换句话说,若存在特殊情况,我需要防止掉到特定列表的列表中

有能力做到这一点吗?

试试这个:

// If you want a specific ul to get sortable you can use this

 $(function() {
    $( ".connectedSortable:eq(0)" ).sortable({
        connectWith: ".connectedSortable"
    }).disableSelection();
});
或者,如果您希望最后一个ul不可排序,请如下使用:

  $(function() {
    $( ".connectedSortable:not(:last)" ).sortable({
        connectWith: ".connectedSortable"
    }).disableSelection();
});
希望这能满足你的需要

  $(function() {
    $( ".connectedSortable:not(:last)" ).sortable({
        connectWith: ".connectedSortable"
    }).disableSelection();
});