如何防止同时掉落在两个小滴上?

时间:2020-08-17 11:33:40

标签: jquery-ui-draggable jquery-ui-droppable

这是我的代码,我正在使用jQuery ui,ui.draggable.position({of:$ {this),my:'right top',at:'right top'});当我取消注释此行之后的无代码行时,此行不起作用。

   $(function() {
    $( ".coursesempty" ).droppable({drop: handleCardDrop});
});   
 function handleCardDrop( event, ui ) {
    // ui.draggable.position( { of: $(this), my: 'right top', at: 'right top' } );
    ui.draggable.draggable( {revert:false});            
    ui.draggable.draggable('disable');
    $(this).droppable({disabled:true});
    // ui.draggable.addClass('zindex_dragble');
    ui.draggable.css({'opacity':'1'});
    var drpbl=$(this);
    ui.draggable.dblclick(function(){
       drpbl.droppable( {disabled : false} );
        //   ui.draggable.removeClass('zindex_dragble');
          ui.draggable.animate({ top: '0px', left: '0px'},500);
          ui.draggable.draggable( {revert:true});
          ui.draggable.draggable('enable');
       }); 
    } //new change anvin end

} enter image description here

0 个答案:

没有答案
相关问题