0

I want to use jquery ui draggable with Repeater. So It will work like when I click the button the draggable will clone with the id. So far it is done that way but the problem is the clone draggable box are not moving.

Please view...

jQuery Ui Draggable with Repeater

I want your very best suggestion the clone Draggable box can be Draggable as well, I can get different id of each boxes...

Bhavik
  • 4,836
  • 3
  • 30
  • 45
user3303878
  • 33
  • 1
  • 7

1 Answers1

0

Check out this fiddle

HTML

<div id="red" class="drag"></div>
<br/>
<div id="forClones"></div>
<input type="button" id="clone" value="clone" />

jQuery

$(document).ready(function () {
    Draggable();
});

function Draggable() {
    $('.drag').draggable({
        cursor: 'move',
        containment: 'document'
    });
}

$('#clone').click(function () {
    var clone = $('#red').clone().attr('class', 'drag');
    $('#forClones').append(clone);
    Draggable();
});  

With a bit help from this answer

Community
  • 1
  • 1
Bhavik
  • 4,836
  • 3
  • 30
  • 45