title: jQuery draggable revert and stop event
body: <p>First question, so be kind :)</p>
  
  <p>What I am trying to do is call a function when the user releases the draggable, and before the revert animation has completed.</p>
  
  <p>As far as I can see, the stop event is called only when the revert has finished. I have tried passing a function to the revert option of draggable, but it doesn't seem to work. Here is a bit of my code to demonstrate;</p>
  
  <pre><code>$("a").draggable({
      helper:function(){
          return $("&lt;div/&gt;",{id:"mydrag",text:"link"}).appendTo("body");
      },
      revert:function(evt,ui){
          // $("#mydrag").fadeOut("slow");
          return true;
      },
      stop:function(evt,ui){
          console.log("fin");
      }
  });
  </code></pre>
  
  <p>If I uncomment the first line of the revert function - fadeout - then the element fades out but does not revert. The console only logs "fin" when the revert animation has completed.</p>
  
  <p>Can anyone help me? Needless to say I have Googled a lot for an answer, but with no luck.</p>
  
  <p>Buster</p>