Skip to content

Instantly share code, notes, and snippets.

@microdesign
Forked from seanmcn/jQueryDroppable.js
Last active September 18, 2015 12:40
Show Gist options
  • Save microdesign/a56ba384c8c43aee2139 to your computer and use it in GitHub Desktop.
Save microdesign/a56ba384c8c43aee2139 to your computer and use it in GitHub Desktop.
jQuery Droppable (Accept only one Draggable)
$(".drop_area").droppable({
tolerance: "intersect",
accept: ".drop_item",
greedy: true,
drop : function(event, ui) {
$(this).droppable( "option", "disabled", true );
},
out : function(event, ui) {
$(this).droppable( "option", "disabled", false );
},
revert: function (event, ui) {
$(this).droppable( "option", "disabled", true );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment