【发布时间】:2011-03-31 18:59:44
【问题描述】:
我有这个标记
<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's chidlren 和#hello 本身中加入元素。我想确定 li 被丢弃的位置。
【问题讨论】:
-
你能发布你的代码的 JSFiddle 示例吗?
-
我已经修复了 html 标记。如果未标记为“代码”,则 Stackoverflow 默认不显示 html
-
ul 元素里面有什么?
-
没关系 会有"li"从其他容器拖过来
标签: jquery jquery-ui droppable