Jquery Draggable List Item Dropping w/ Cloning
I am currently having issues with a project. When using the jquery drag/drop functionality, I am creating a clone. The idea is to have data fill the item to be dragged to a larger list upon each click of a button. When the item is dragged into t开发者_开发知识库he list and the clone created, the data is passed to the original item, not the clone as it should be. The following is the code used to create the item:
$(document).ready(function(){
$("#dragme").draggable({
helper : 'clone',
revert : 'invalid',
connectToSortable: '#sortable',
start: function(e,ui){
ui.helper.find('.caption').text("I'm being dragged!");
},
stop: function(e,ui){
var high_id = -1;
$("#dragme").clone(true).removeAttr("id").removeClass("songsearchform").attr("id", "high_id").insertBefore('#sortable');
}
});
Is there a way to fix it so that the item is dragged into the main list, but then resets to allow for new data on the clone in the original position?
精彩评论