tags:

views:

76

answers:

2

Hi guys,

var icon = $("<div style='width:100px;height:100px;border-style:solid;'>");
icon.draggable({
    containment: 'parent',
    axis: 'y',
    drag: function(e,ui) { }
});
icon.clone(true).appendTo($("body"));

After I have made a clone, icon dragging stopped working. Does anybody know, how to fix this?

Thanks

A: 

What exactly you wanna do? Do you really need to clone? You can use one of the draggable() options: helper, which clones the element as just as you drag. See it in action: http://jsfiddle.net/nZm5H/

If you need to clone this way you do, you have to make the clone to be draggable also: like this

Rodrigo Alves
your first example doesn't work, the pint here I think is that you should be able to clone all the events which is why the true is set as a clone parameter so you should have to call draggable on clone
mcgrailm
@mcgrailm of course it's working. Maybe it's your borwser or browser settings. Look it through, buddy
Rodrigo Alves
Nope sorry man doesn't work I tried in ff 3.6.3 mac and safari mac and ie6 on xp
mcgrailm
+1  A: 

The draggable functionality does not stop working.

However, when you hold your mouse over the clone and move it around, it is the original element that gets dragged.

Click here to see this behaviour: http://www.jsfiddle.net/bxH3Q/

To get around this, you have to make each clone draggable.

Ed Saito