且构网

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

jQuery UI:从原始 div 中拖动和克隆,但保留克隆

更新时间:2023-12-05 21:58:10

这是我最终做的有效的:

Here is what I finally did that worked:

$(".box-clone").live('mouseover', function() {
    $(this).draggable({ 
        axis: 'y',
        containment: 'html'
    });
});
$(".box").draggable({ 
    axis: 'y',
    containment: 'html',
    helper: 'clone',
    stop: function(event, ui) {
        $(ui.helper).clone(true).removeClass('box ui-draggable ui-draggable-dragging').addClass('box-clone').appendTo('body');
    }
});