0
我使用jQuery-ui可拖动和拖放。 我想在任何可拖动项目放在主体中的任何位置之后运行一个函数。jQuery - 删除后运行一个函数
我这样做,但它不会工作:
jQuery(document).drop(function(){
alert('A draggable item dropped somewhere');
});
我使用jQuery-ui可拖动和拖放。 我想在任何可拖动项目放在主体中的任何位置之后运行一个函数。jQuery - 删除后运行一个函数
我这样做,但它不会工作:
jQuery(document).drop(function(){
alert('A draggable item dropped somewhere');
});
检查此链接http://jqueryui.com/droppable/
$("#droppable").droppable({
drop: function(event, ui) {
$(this).addClass("ui-state-highlight").find("p").html("Dropped!");
}
});
这里查看示例代码:http://jqueryui.com/droppable/ 你想要的东西,如:
$("#droppable").droppable({ alert('dropped'); });
如果您将可放置的ID添加到身体,它应该可以工作标签。
你的'droppable'配置如何? –