且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 jquery 可排序时如何复制项目?

更新时间:2023-10-30 20:44:40

首先,看看这个,并阅读@Erez 的答案.

For a beginning, have a look at this, and read @Erez answer, too.

$(function () {
    $("#sortable1").sortable({
        connectWith: ".connectedSortable",
        remove: function (event, ui) {
            ui.item.clone().appendTo('#sortable2');
            $(this).sortable('cancel');
        }
    }).disableSelection();

    $("#sortable2").sortable({
        connectWith: ".connectedSortable"
    }).disableSelection();
});