悬停可拖动时更改拖动克隆的大小? [英] Change the size of dragged clone when hovering droppable?

查看:147
本文介绍了悬停可拖动时更改拖动克隆的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(".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'});

这篇关于悬停可拖动时更改拖动克隆的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆