我有一个拖放代码在服务器端创建的 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() {
......
});
似乎不起作用...任何想法如何解决这个问题?
谢谢