I'm trying to do something like this
01 ...do some heavy duty stuff
02
03 $('...').fadeOut(function () {
04 $(this).remove();
05 });
06 ...do some heavy duty stuff
07 ...add some rows <tr>
However, the fadeOut callback function does not work immediately. Because of this, my logic of adding new lines after they are deleted does not work properly. I know that I can put the code on lines 6 and 7 inside the callback, but I do not want to do this because the callback has a lot of logic and receives the call from other places.
Is there a way to force fadeout () to complete its callback before it reaches line 6?
source
share