简体   繁体   English

jQuery拖放-轻松

[英]Jquery drag and drop - ease

How to add smooth or animate for jquery drag & drop? 如何为jQuery拖放添加平滑或动画?

Here's my code: 这是我的代码:

<!-- Drag and Drop -->  
     $("#sortable-left, #sortable-right").sortable({
         connectWith: ".connectedSortable",
         receive: function(e,ui){
         }
     });

     $("#sortable-right").on("click", "li a", function (){       
         $(this).closest('li').remove();        
     });

    $("#sortable-right").on("click", ".drop-close", function(){
        $("ul#sortable-left").append('<li class="ui-state-default ui-sortable-handle"> <strong>'+$(this).parents("li").find("strong").text()+'</strong><div class="ui-plus-desc"> <a class="drop-close" data-toggle="tooltip" data-original-title="Remove">                                                        <i class="fa fa-times"></i></a><span>at 11:47, 21 June 2014</span><span>by Mark Antany</span></div></li>');
    });
    <!-- Drag and Drop -->

I am not sure but the below might work 我不确定,但以下内容可能有效
When you click on the item to be dropped make its position:fixed and then ondrag change its position offset to the mouse pointers position 当您单击要放置的项目时,将其位置固定:然后固定并拖动以将其位置偏移量更改为鼠标指针的位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM