jquery ui droppable on parent child issue

后端 未结 1 1330
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 06:09

I am using jquery ui droppable widget. I have the following structure :

Example Fiddle

 
parent
1条回答
  •  -上瘾入骨i
    2021-01-13 06:54

    I guess the better way is to use greedy option of droppable. Don't forget to go through the API if you find any problem. http://api.jqueryui.com/droppable/#option-greedy

    Here is how your code looks like with greedy option

    $(".child").droppable({ 
        accept: '.item',
        greedy: true,
        drop: function(e, ui){ 
         alert("drop on child");
        }
    });
    

    There you go... !!!

    0 讨论(0)
提交回复
热议问题