title: jQuery UI modal dialog overlay fade out
body: <p>Is it possible to apply a fade out effect on the jQuery UI modal dialog box overlay? The issue is that the overlay div is destroyed when the modal dialog box is closed preventing any kind of animation. This is the code I have that would work if the overlay div was not destroyed on close.</p>
  
  <pre><code>$("#edit-dialog-box").dialog(
  {
      autoOpen: false,
      modal: true,
      width: "30em",
      show: "fade",
      hide: "fade",
      open: function()
      {
          $(".ui-widget-overlay").hide().fadeIn();
      },
      close: function()
      {
          $(".ui-widget-overlay").fadeOut();
      }
  });
  </code></pre>