I have two divs: one draggable and one droppable
<div id="draggable" class="block" runat="server">
</div>
<div id="dd" class="drop" title="drophere">
</div>
When I release the draggable div I want to find the class of it's parent to take an action if it开发者_开发技巧 is dropped on a droppable div, otherwise cancel the dragging.
I want to put a condition in the stop function of the draggable that if it's dropped on a div with class "drop" then it's ok, otherwise cancel the drag operation
What can be the function that performs this ?
thanks.
Thanks All
I got it at this link http://jqueryui.com/demos/droppable/#revert
this makes the div reverts if not dropped on a droppable.
Normally you would do this by using the draggable and droppable plugins like this...
$(".block").draggable();
$(".drop").droppable();
Which gives you the behaviour you are after (i.e. you can only drop on a droppable).
精彩评论