I am trying to do something like this
01 ...do some heavy duty stuff
02 //delete some rows <tr>
03 $('...').fadeOut(function () {
04 $(this).remove();
05 });
06 ...do some heavy duty stuff
07 ...add some rows <tr>
However the fadeOut's call back function doesn't get fire immediately. Because of this my logic of adding new rows after removing them does not work properly. I know I can place the code at line 6 and 7 inside the callback but I don't want to do this because the callback has alot of logic and gets called from other places.
Is there a way I can force fadeout() to complete executing its callback before it reaches line 6?