可放置的droppable [英] droppable in droppable
本文介绍了可放置的droppable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这个标记
<ul id="hello" class="cat">
<ul id="a1" class="cat">
</ul>
<ul id="a2" class="cat">
</ul>
</ul>
我做了这件事
$("ul.cat").droppable(
{
drop:function()
{
alert($(this).attr("id"));
}
});
它总是写你好。
只有你好。
如何在子节点上绑定droppable?
It always write "hello". only "hello". How can I bind droppable on childs too?
UPD:我希望删除#hello的chidlren和#hello本身的元素。我想确定li被丢弃的位置。
UPD: I want drop in elements in #hello's chidlren AND #hello itself. I want to determine where li was dropped.
推荐答案
我找到了解决方案:#hello needs 贪心:真实
I've found the solution: #hello needs greedy:true
http://jqueryui.com/demos/droppable/#propagation
这篇关于可放置的droppable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文