Moumita
Moumita

Reputation: 360

How to show image clone when drag?

I am new to jquery. I find a code to drag a image clone and drop on a area. but when I'm dragging that image it directly append on drop region. it was not show during dragging.

$(document).ready(function(){  
 $('#dhtmlgoodies_xpPane li .rotatable').draggable({appendTo: "working-area", helper: "clone" });

 $( "#working-area" ).droppable({ activeClass: "ui-state-default", 
                                  hoverClass: "ui-state-hover",
                                  accept: "#dhtmlgoodies_xpPane li .rotatable",
                                  drop: function( event, ui ) 
                                        {
                                            $(this).append($(ui.helper).clone().draggable());   
                                        }       
                                });
 });
});

please anyone help to find solution.

Upvotes: 2

Views: 858

Answers (1)

Adam Ayres
Adam Ayres

Reputation: 8900

I think the issue was the appendTo of the draggable. When I removed this it works as expected:

http://jsfiddle.net/q3zCc/4/

Upvotes: 1

Related Questions