Droppable in droppable
I have this markup
<ul id="hello" class="cat"> <ul id="a1" class="cat"> </ul> <ul id="a2" class="cat"> </ul> </ul> I did this thing
$("ul.cat").droppable( { drop:function() { alert($(this).attr("id")); } }); He always says hello. just hello. How can I associate droppable with children?
UPD: I want to add elements to #hello chidlren AND #hello. I want to determine where the identity was deleted.
+2
takayoshi
source share3 answers
I found a solution: #hello needs greedy:true
+6
takayoshi
source sharetry the following:
$("ul.cat").each(function(){ $(this).droppable( { drop:function() { alert($(this).attr("id")); } }); }) 0
Neal
source shareIt will bubble up to the top UL, which you don't want droppable. Try the following:
$("#hello ul.cat").droppable( { drop:function() { alert($(this).attr("id")); } }); 0
rsplak
source share