title: How to close Jquery popup window when clicking of the "window area" and how to make the background dull?
body: <p>I have a popup box here and I would like to make two things. First , when the pop up window is shown I would like the &quot;outside-of-the-pop-up-window area&quot; to be shown a bit darker. Secondly, I would like the popup window to close when i click of it's area. Here is my script :</p>
  <pre><code>&lt;script&gt;
  $(&quot;a&quot;).click(function(event) 
  {
    $(this).parent().parent().children(&quot;.dialog&quot;).dialog(
    {
      width: 600,
      close: function( event, ui ) 
      {
        $(this).dialog('destroy');
      }
    });
  });
  &lt;/script&gt;
  </code></pre>
  <p>and my html code :</p>
  <pre><code>  &lt;div class=&quot;content&quot;&gt;
       &lt;h4&gt;
          &lt;a href=&quot;#&quot; &gt;AAAA &lt;/a&gt; 
      &lt;/h4&gt; 
      &lt;img src=&quot;AAAA.jpg&quot; /&gt;
      &lt;div class=&quot;dialog&quot; title=&quot;AAAA&quot; &gt;text
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  <p>Is there a certain function that do this 2 things in jquery?</p>