0

I have a page (created not by me) with two divs. This divs contains some span elements, they can be drag&dropped between this divs. This functionality implemented using jQuery draggable and droppable function. But user is able to drop span element not only at div, but at any place of page. Question is: how can I prevent this? I need to disable dropping span at any place except this divs. Dragged span should return to place where it was taken.

Can I make it with JQuery?

4

1 回答 1

1

revert可拖动对象的选项设置为,invalid以便它们在未放置在兼容的可放置对象上时返回到其原始位置。

droppables 还应该具有accept适当设置的选项以接受draggables。

于 2012-09-18T11:00:57.863 回答