开发者

Combining revert with jQuery draggable/droppable

I'm using the drag and drop plugin with jQuery UI. I'd like to make it so that the drag开发者_Python百科gable container can only be dragged and dropped on the container. In the demonstration:

http://jqueryui.com/demos/droppable/#revert

It has 2 options. One is to revert when it drags to the container, the second is to revert when it isn't dragged to the container.

Is there a way to combine these two? I don't want to be able to drag the #draggable container anywhere where there isn't a #droppable container.


As stated above, I found the solution by adding :

$('#draggable2').remove(); 
$('#draggable').draggable({ revert: true });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜