I have a <tr>
which will be removed when clicked in delete button, but before doing .remove()
or empty()
I'd like to wait for some fadeOut()
effect.
$(this).closest('tr').fadeOut();
setTimeout("$(this).closest('tr').remove()",1000);
is not working, it only fades out.
I have a <tr>
which will be removed when clicked in delete button, but before doing .remove()
or empty()
I'd like to wait for some fadeOut()
effect.
$(this).closest('tr').fadeOut();
setTimeout("$(this).closest('tr').remove()",1000);
is not working, it only fades out.
Share Improve this question edited Jan 29, 2016 at 8:50 dialogik 9,55218 gold badges78 silver badges121 bronze badges asked Jun 24, 2010 at 22:41 Rodrigo SouzaRodrigo Souza 7,33212 gold badges43 silver badges73 bronze badges 1 |1 Answer
Reset to default 22You need a callback after fadeOut()
$(this).closest('tr').fadeOut(400, function(){
$(this).remove();
});
It fires the callback just after the fadeOut()
operation is done, in this case after 400ms
.
Hope this helps, Sinan.
$(this).closest('tr').hide('slow')
– Martin Wickman Commented May 23, 2016 at 7:56