Jquery draggable persistence either through mysql or saving cookie in the database?
- by Muhammad Jehanzaib
I want to know that how can I persist the divs dropped on a draggable. I have been trying since long but stuck at this point. Actually you can see the demo here. I have to save the user designed wedding floor. So whenever user logins next time he/ she is able to see the last design saved. The code is shown below:
$(document).ready(function() {
$("#droppable").droppable({
accept: '.draggable',
drop: function(event, ui) {
$(this).append($(ui.draggable).clone());
$("#droppable .draggable").addClass("objects");
$(".objects").removeClass("ui-draggable draggable");
$(".objects").draggable({
containment: 'parent',
});
}
});
$(".draggable").draggable({
helper: 'clone',
tolerance: 'touch',
cursor:'move'
});
});