title: jQuery UI Dialog Auto-Close using setTimeout
body: <p>I'm trying to have my dialog auto-close three seconds after opening. I've tried the following methods:</p>
  
  <pre><code>setTimeout($("#mydialog").dialog('close'), 3000);
  </code></pre>
  
  <p>Here it is in context:</p>
  
  <pre><code>$("#acknowledged-dialog").dialog({
      height: 140,
      modal: true
  });
  
  setTimeout($("#acknowledged-dialog").dialog('close'), 3000);
  </code></pre>
  
  <p>But with this method, it doesn't even show! I'm guessing the the close method is getting called immediately after it gets shown on the page. The log shows no errors.</p>
  
  <p>I've also tried binding to the dialogopen event:</p>
  
  <pre><code>$("#acknowledged-dialog").bind('dialogopen', function(event, ui) {
      setTimeout($(this).dialog('close'), 3000);
  });
  $("#acknowledged-dialog").dialog({
      height: 140,
      modal: true
  });
  </code></pre>
  
  <p>The dialog shows, but does not auto-close. No error in the logs here either.</p>
  
  <p>Am I not able to use 'this' in the argument for $ in setTimeout?</p>