嗨具有以下功能的正常工作:传递对象使用jQuery
jQuery('.btnRemoveItem').click(function(obj){
jQuery(this).closest('li').fadeOut(400, function() { $(this).remove(); }); // This works
});
在此HTML代码:
<li id="listItem_dsc_6440.jpg">
<div class="buttonPanel">
<span title="Delete image" class="btnRemoveItem floatRight" id="dsc_6440.jpg"> </span>
</div>
</li>
这变淡下列表项,然后删除它。
现在我加入了jQuery.post
,我需要把淡出/删除这里面.POST
jQuery('.btnRemoveItem').click(function(obj){
jQuery.post("wp-content/themes/storelocator/include/adm_gallery.php", { deleteImage: 'single', name: jQuery(this).attr('id') },
function(data){
if(data.status == 'deleted');
{
jQuery(obj).closest('li').fadeOut(400, function() { $(this).remove(); });
}
}, "json");
});
当然,这是行不通的。我很确定这是因为我不知道obj
是什么 - 以及我如何使用它。
任何人都可以帮助我吗?
Thos很棒。谢谢! – Steven