Reputation: 2914
I am creating to create drag and drop functionality using jquery UI
. However , the drop event isn't getting triggered when I drop something on the body
Here is my demo code.Any help will be appreciated.
Upvotes: 0
Views: 499
Reputation: 4918
Change
$( "body" ).droppable({
to:
$( "#droppable" ).droppable({
Here is the jsFiddle
UPDATE
You almost had it, the problem was that your body didn't have a height, which was identified by giving it a css border. Once a height was set using body{height:200px;}
then it worked.
new jsFiddle in response to comments:
Upvotes: 1
Reputation: 1598
Update your code from
$("body").droppable
to
$("#droppable").droppable...
You can check the same at http://jsfiddle.net/anubhavranjan/yEvsY/
For more info, visit http://jqueryui.com/droppable
Upvotes: 0