jquery抓取網頁內容
jQuery Droppable,刪除元素 (1)
從drop事件文檔中 :
當可接受的拖動器被丟棄(在容差範圍內)此可放置時,將觸發此事件。 在回調中,$(this)表示draggable被丟棄的droppable。 ui.draggable代表可拖動的。
所以:
$("#dock").droppable({
drop: function(event, ui) {
// do something with the dock
$(this).doSomething();
// do something with the draggable item
$(ui.draggable).doSomething();
}
});
一個小問題希望通過一個簡單的答案,我使用jQuery draggable和droppable將項目放入Dock。 使用下面的代碼進行刪除。
$("#dock").droppable({
drop: function(event, ui) {
//Do something to the element dropped?!?
}
});
但是我找不到一種方法來獲取實際丟棄的元素,所以我可以做一些事情。 這可能嗎?