在droppable out事件期间,我需要鼠标光标移动到的元素。如果该元素不可放置,则应执行默认行为。
我尝试了以下操作:
$(dropSelector).droppable({
over: function (event,ui) {
ui.helper.css("cursor","copy");
// Some code on drop enter here...
},out: function (event,ui) {
// New element: mouse pointer might move to another droppable element...
// How to obtain the element where the mouse moves to?
if (/* next element is NOT droppable*/) {
ui.helper.css("cursor","no-drop");
// Some code on drop out here...
}
},drop: function (event,ui) {
// handle drop event
}
});
但是,我找不到一种方法来获取out
事件期间鼠标光标移动到的元素。我尝试了event.target
和event.currentTarget
,但它们不是我想要的元素正在寻找。