title: How to programmatically invoke jQuery UI Draggable drag start?
body: <p>I create a new jQuery element after the mouse is in a down position and before it is released.  (After mousedown).</p>
  
  <p>I would like to programmatically trigger <code>dragging</code> on the new element using jQuery UI, so that it will automatically begin dragging with my mouse movement.  I don't want to have to release and then click the mouse again.</p>
  
  <p>I have tried the following...</p>
  
  <pre><code>var element = $("&lt;div /&gt;");
  element.appendTo("body").draggable().trigger("mousedown");
  </code></pre>
  
  <p>...however this does not work.  </p>
  
  <p>Does anyone have any suggestions on how to accomplish this?</p>
  
  <hr>
  
  <p><strong>UPDATE:</strong>  After some searching the poster of <a href="https://stackoverflow.com/questions/8759884/jquery-how-to-fire-the-drag-event-while-mouse-is-still-down">this question</a> has the identical problem.  However the suggested solution, which boils down to...</p>
  
  <pre><code>$("body").on("mousedown", function(e) { 
    $("&lt;div /&gt;").draggable().appendTo("body").trigger(e);
  });
  </code></pre>
  
  <p>...no longer works in the latest versions jQuery and jQuery-UI, and instead generates a Maximum Call Stack Exceeded error.</p>