【问题标题】:Change the size of dragged clone when hovering droppable?悬停可放置时更改拖动克隆的大小?
【发布时间】:2015-11-16 13:12:23
【问题描述】:
$(".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'});
      }
      }});

当我将鼠标悬停在可放置区域上时,我试图更改拖动的克隆项目的大小,但保持原来的大小相同(这样当我在正确的放置区域上时,附加到鼠标的项目会缩小)。此代码更改原始但不更改克隆。有什么建议么?

【问题讨论】:

  • 你能把你的html代码贴在这里吗?

标签: jquery drag-and-drop hover height width


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 2015-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-23
    • 2011-07-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多