Skip to content

Instantly share code, notes, and snippets.

@stuffmc
Created August 8, 2011 20:37
Show Gist options
  • Save stuffmc/1132675 to your computer and use it in GitHub Desktop.
Save stuffmc/1132675 to your computer and use it in GitHub Desktop.
jQuery-ui Draggable Droppable can't drop
$(".ui-sortable tr").each(function() {
$($(this)).droppable({
accept: "tr",
drop: function(e, ui) {
console.log('dropped');
},
over: function(e, ui) {
ui.draggable.insertAfter(this);
}
});
});
@stuffmc
Copy link
Author

stuffmc commented Aug 8, 2011

Note: the "over" code works perfect. the console.log in "drop" doesn't get printed. Any idea why?

@stuffmc
Copy link
Author

stuffmc commented Aug 8, 2011

FYI: turns out in some circumstances the "over" is called and not the "drop". Since I don't really need the "over", I'm fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment