안녕을 사용하여 객체에 전달 잘 작동 다음과 같은 기능이 있습니다이 HTML 코드에는 jQuery를
jQuery('.btnRemoveItem').click(function(obj){
jQuery(this).closest('li').fadeOut(400, function() { $(this).remove(); }); // This works
});
:
<li id="listItem_dsc_6440.jpg">
<div class="buttonPanel">
<span title="Delete image" class="btnRemoveItem floatRight" id="dsc_6440.jpg"> </span>
</div>
</li>
이 목록의 항목을 페이드가, 다음을 제거합니다. 이것은 물론
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");
});
는,이 작동하지 않습니다 .post 내부
지금 나는 jQuery.post
를 추가 그리고 난 제거/페이드 아웃을 넣어해야합니다. 나는 그것이 obj
이 무엇인지 모르기 때문에 그것이라고 확신합니다. 어떻게 사용할 수 있습니까?
아무도 도와 줄 수 있습니까?
Thos가 훌륭하게 작동했습니다. 감사! – Steven