我在droppable上添加了greedy:true选项,但在将一个元素拖入子元素后,父元素没有响应。我认为这是jqueryui的一个问题。
要重现将一个元素放入子元素,然后尝试将另一个元素直接放入父元素中(不先将子元素移过子元素),父元素将不会是border:green(不调用over函数)
$("#right, #right *").droppable({
greedy:true,
tolerance:"pointer",
cursor:"pointer",
drop: function(event, ui) {
if ($(this).attr("id")!="right") $(this).css("height","auto");
$(this).css("border","3px solid blue");
$("<div>appended</div>").appendTo(this);
},
over: function(event, ui) {
$(this).css("border","3px solid green"); //this is failing in the parent
},
out: function(event, ui) {
$(this).css("border","3px solid blue");
}
});