Hi all , Can anyone help me by telling me that in the given code below when the first time element is dragged it works fine but when a new element is dragged then the draggable property of the earlier created element is lost. How can i do the dragging without losing it?
if(tag==normal_tag1.id)
{
normal_tag_d=' <div id="Normal_Tag1_div_dummy'+count1+'" class ="Normal_Tag1_div_dummy" >'+ 'Normal DUMMY</div>';
document.getElementById('droppable').innerHTML+=normal_tag_d;
var idx='#Normal_Tag1_div_dummy'+count1;
$(idx).draggable(
{
revert: 'invalid'
}
);
var droppable="#droppable";
$(droppable).droppable({
drop: function(ev,ui) {
alert(ui.draggable);
}
});
count1++;
}
else if(tag==normal_tag2.id)
{
normal_tag2_d=' <div id="Normal_Tag2_div_dummy'+count2+'" class ="Normal_Tag2_div_dummy" >'+
'Normal DUMMY2</div>';
var id='#Normal_Tag2_div_dummy'+count2;
document.getElementById('droppable').innerHTML+=normal_tag2_d;
$(id).draggable({
revert: 'invalid'
});
$("#droppable").droppable({
drop: function() {
}
});
count2++;
}