Last active
March 11, 2016 07:41
-
-
Save seanmcn/3638884 to your computer and use it in GitHub Desktop.
jQuery Droppable (Accept only one Draggable)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".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 ); | |
} | |
}); |
How do you append the draggable object to the droppable?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tolerance: interesect probably isn't needed for most projects.