0

I have two sortable lists contains some div items. When I drag and drop an item from one list to another, one popup should open which ask me for "Yes" and "No". Action has to complete based on the button click of the popup. How can I do this?

user3463568
  • 103
  • 1
  • 6
  • What have you tried? Can you provide a [fiddle](http://jsfiddle.net/) containing an example to reproduce? – Volune Aug 23 '14 at 10:40

1 Answers1

0
function drop(event, ui) {
   var answer = confirm('Do you want to drop the item?');
   if(answer) {
      //drop the item.
      var elem2 = $(ui.draggable);
      $(this).addClass('item-dropped').html(elem2.html());
   }
}
$('.items').draggable();
$('#list1 .items').droppable({
   accept: '#list2 .items',
   drop: drop(event, ui);
});
$('#list2 .items').droppable({
   accept: '#list1 .items',
   drop: drop(event, ui);
});

Look at the jQuery documentation to learn more about draggable and droppable.

Bluedayz
  • 599
  • 5
  • 17