基本上有兩個表:公司和訪客。目前可以將訪問者拖到公司。很棒。一旦發生拖放功能,就有兩個$ .post。第一個將拖動保存到數據庫。第二個更新訪問者,因爲信息不斷變化。但問題是,一旦第二.post的$結束,螢火蟲不斷出現以下錯誤:jQuery live draggable/live droppable?
d(this).data("draggable") is null
其中在jQuery UI的文件時發生。在線56.
約400次左右。所以基本上我正在尋找一種可以拖動和拖放的live()方法。
.draggables在#visitors(an ul)中。可放入的文件在#companies(表格)中。
謝謝!
$(".draggable").draggable({
revert:true
});
$(".droppable").droppable({
drop: function(ev, ui) {
$(this).text($(ui.draggable).text());
$.post('planning/save_visit', {user_id: $(ui.draggable).attr('id'), company_id: $(this).attr('id'), period: $('ul.periods li.active').attr('id')});
$.post('planning/' + $('ul.periods li.active').attr('id'), {visitors:true}, function(data){
$('#visitors').html(data);
});
},
hoverClass: 'drophover'
});
非常感謝!這很好! – Henk 2010-06-25 06:17:10