我有这个标记
<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 也绑定到孩子身上?
UPD:我想在 #hello 的子元素和 #hello 本身中添加元素。我想确定李被扔到哪里了。
我找到了解决方案:#hello 需要greedy:true
http://jqueryui.com/demos/droppable/#propagation http://jqueryui.com/demos/droppable/#propagation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)