如何通过Ajax删除项目时刷新Masonry?这是我用来删除项目的代码:
if($deletes = $('a[rel=delete]')) {
$deletes.click(function() {
if(!window.confirm('Are you sure you wish to delete this picture?'))
return false;
$t = $(this);
$.post(
$t.attr('href'),
{},
function(data) {
if(data == "success")
$t.parents('.deleteable:first').fadeOut();
}
);
return false;
});
}
Run Code Online (Sandbox Code Playgroud)
我想要刷新的原因是在删除项目后消除结果空格.