title: JQuery delete DOM element after fading out
body: <p>I want to delete an DOM element right after fading out. What I did so far is</p>
  
  <pre><code>$(element).click(function()
  {
      $(this).fadeOut(500, function() { $().remove(this); });
  });
  </code></pre>
  
  <p>But now I always get this error in Firebug: <a href="http://dl.getdropbox.com/u/5912/Jing/2009-02-04_1109.png" rel="noreferrer">http://dl.getdropbox.com/u/5912/Jing/2009-02-04_1109.png</a></p>
  
  <p>I guess it is because the fadeOut function is not really done when the callback gets called. And I can not put the <code>$.remove()</code> part after the fadeOut call because otherwise it gets removed instantly.</p>
  
  <p>So do you know of any way I can do this better?</p>