Prevent drop of list item in JqueryUI sortable

前端 未结 8 2040
情歌与酒
情歌与酒 2020-12-23 22:19

I have two lists #sortable1 and #sortable 2 which are connected sortables, as shown in this example.

You can drag and drop list items from

8条回答
  •  借酒劲吻你
    2020-12-23 22:52

    Try this example

    $('#list1').sortable({
        connectWith: 'ul'
    });    
    
    $('#list2').sortable({
        connectWith: 'ul',
        receive: function(ev, ui) {
            if(ui.item.hasClass("number"))
              ui.sender.sortable("cancel");
        }
    });    
    

提交回复
热议问题