Making jQuery Fadeout() callback function synchronous
<p>I am trying to do something like this</p>

<pre><code>01 ...do some heavy duty stuff

02   //delete some rows &lt;tr&gt;
03 $('...').fadeOut(function () {
04     $(this).remove();
05 }); 

06 ...do some heavy duty stuff
07 ...add some rows &lt;tr&gt;
</code></pre>

<p>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.</p>

<p>Is there a way I can force fadeout() to complete executing its callback before it reaches line 6?</p>
