Prevent drop of list item in JqueryUI sortable

前端 未结 8 2039
情歌与酒
情歌与酒 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条回答
  •  梦毁少年i
    2020-12-23 22:50

    beforeStop: function(ev, ui) {
                    if ($(ui.item).hasClass('number') && 
                        $(ui.placeholder).parent()[0] != this) {
                        $(this).sortable('cancel');
                    }
                }
    

    try this.

提交回复
热议问题