サーバー側で作成されたdivでドラッグアンドドロップコードが完全に機能しますが、jqueryを使用して(動的に)divを作成すると、コンテナに何もドロップできないようです...
$('.dropcontent').droppable({
accept: '.item',
drop: function(ev, ui) {
/* do something */
}
});
$(".item").draggable({
helper:'clone',
appendTo: 'body',
snap: true,
revert: true
});
<div id="row1seo" class="dropcontent" > </div> // original code on server side
<div id="row1seo" class="dropcontent ui-droppable"> </div> // the above line becomes this on client side showing it has "binded" with the droppable
<div id="row2seo" class="dropcontent"></div> // this the dynamically created div which doesn't seem to bind with the droppable. this is created in php file using ajax to retrieve it
私も試してみました
$(".dropcontent").live('droppable', function() {
......
});
うまくいかないようです...これを修正する方法はありますか?
ありがとう