Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
fancyboxダイアログを呼び出すための私のコードは次のとおりです。
$('.btnUpdateitem').fancybox({ openEffect : 'elastic', closeEffect : 'elastic', });
特定のテーブル行を削除するためのコードは次のとおりです。
$(this).closest('tr').remove();
しかし、私のテーブルはajaxの結果に基づいています:
$(this)が参照するコンテキストがわからないため、次のようになります。
適切な状況で
$cachedClosest = $(this).closest('tr');
fancyboxを呼び出す
$('.btnUpdateitem').fancybox({ openEffect : 'elastic', closeEffect : 'elastic', afterClose: function() { $cachedClosest.remove(); }) });
それが少し役立つことを願っています