我有一个使用JQUERY UI的小javascript。
当我得到“drop”事件调用时,我想知道哪个HTML元素被删除了。有没有人能告诉我怎么弄清楚。
我知道如何判断哪个HTML元素接收了事件,但是我不知道如何判断哪个HTML元素被丢弃了
$(function() {
$( "#draggable,#draggable2,#draggable3" ).draggable({ revert: "invalid" });
$( "#draggable,#draggable2,#draggable3" ).droppable({
accept: "#draggable,#draggable2,#draggable3",
activeClass: "ui-state-hover",
hoverClass: "ui-state-active",
drop: function( event, ui ) {
alert("destination:"+ this.id+" source:"+event.target.id);
alert("source is "+"???");
});
});发布于 2012-06-23 00:21:18
在drop函数中,它将是ui.draggable。
https://stackoverflow.com/questions/11160200
复制相似问题