title: jQuery - function with custom callback
body: <p>I'm trying to execute a specific function once some processes finished executing.</p>
  
  <p>My specific example refers to a number of animate() methods after which I want to call another function, however this function should only be called once the animate() methods finished processing:</p>
  
  <pre><code>var testObject = {
      methodOne : function(callbackMethod) {
          $('#item').animate({ 'paddingLeft' : '20px'}, { duration: 200, queue: false });
          $('#item2').animate({ 'paddingLeft' : '30px'}, { duration: 200, queue: false });
          $('#item3').animate({ 'paddingLeft' : '40px'}, { duration: 200, queue: false });
          testObject.callbackMethod();
      },
      run : function() {
          alert('done');
      }
  };
  
  $(function() {
  
        testObject.methodOne(run);
  
  });
  </code></pre>
  
  <p>Any idea how can I achieve this?</p>