悬停可拖动时更改拖动克隆的大小?

悬停可拖动时更改拖动克隆的大小?

问题描述:

$(".drag").draggable({
helper: 'clone',
appendTo: "body"
});


$( ".drop" ).droppable({
over: function(event, ui) {
       $(ui.draggable).css({width:'30px',height:'30px'});
        },

drop: function( event, ui ) {
    if($(ui.draggable).parent() !==$(this)){
        $(ui.draggable).appendTo($( this ));
        $(ui.draggable).tooltip({ disabled: true });
        $(ui.draggable).css({float:'left'});
      }
      }});

我试图改变拖动克隆项目的大小,当我将鼠标悬停在可拖动区域上时,原始大小相同(这样,当鼠标移动到正确的拖放区时,附加到鼠标上的项目会缩小)。该代码更改了原始文件,但不是克隆版本。有什么建议么?

I am trying to change the size of the dragged clone item when i hover over the droppable area but leave the original the same size (so that the item attached to the mouse shrinks when im over the correct dropzone). This code changes the original but not the clone. Any suggestions?

这个工作完成了。直接访问克隆助手。

this did the job. Accessed the clone helper directly.

$( ui.helper).css({width:'30px',height:'30px'});