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 "outside-of-the-pop-up-window area" 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 :
<script>
$("a").click(function(event)
{
$(this).parent().parent().children(".dialog").dialog(
{
width: 600,
close: function( event, ui )
{
$(this).dialog('destroy');
}
});
});
</script>
and my html code :
<div class="content">
<h4>
<a href="#" >AAAA </a>
</h4>
<img src="AAAA.jpg" />
<div class="dialog" title="AAAA" >text
</div>
</div>
Is there a certain function that do this 2 things in jquery?