2
項目和拖放排序我想gp_item應該是排序,當阻力和下gp_delete區域gp_item應該被刪除下降。與刪除
當我做了,它要麼工作排序或刪除。兩者不能一起工作。
<div id='container_gp'>
<div id='1' class='gp_item'> Graph 1</div>
<div id='2' class='gp_item'> Graph 2</div>
<div id='3' class='gp_item'> Graph 3</div>
</div>
<div id='gp_delete'>Drop to delete here </div>
我寫過這樣的。
$('.gp_item').draggable({
revert: true,
proxy:'clone'
});
$("#gp_delete").droppable({
activeClass: "active",
drop: function(event, ui) {
if(confirm("Are you sure you wish to delete"))
{
//delete code
ui.draggable.remove();
}
}
});
東西像這樣:http://jsfiddle.net/ckWKE/? –