Restricting the drop area with jQuery UI draggable()
jquery:
$('#divDroppable div').draggable({
appendTo: "div.mainContainer div",
revert: true,
containment: $("div.mainContainer > div" ),
helper: "clone"
//drop: handleCardDrop
//cursor: "move"
//snap: 'div.mainContainer div'
});
How do I restrict the dropped item to div.mainContainer > div
? Otherwise, it should revert to the original place. The helper class is also not worki开发者_StackOverflowng properly.
精彩评论