Window in jquery
<p>I call window: </p>

<pre><code>$(function(){
$('.link').live('click', function(){
    var perf = $(this).attr('id');
    var action = 'develop';
    var user_id=$('#user_id').val();
    var dataString = 'action='+action+'&amp;perf='+perf+'&amp;user='+user_id;

    $.ajax({
        type: "POST",
        url: "test.php",
        data: dataString,
        cache: false,
        success: function(html){
            $("#work-window").append(html);
        }
    });
});
});
</code></pre>

<p>Result in html: </p>

<pre><code>&lt;div id="div-add"&gt;
&lt;span id="link-close"&gt;`[close]`&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Code for close window when you click on link (#link-close):</p>

<pre><code>$('#link-close').live('click', function(){
    $('#div-add').css('visibility', 'hidden');
});
</code></pre>

<p>But here have bug. Window closing only one times. When you reopen the window and trying close, then this is not close. As remove this problem?</p>

<ul>
<li>How to do that window closing when you click on outside.</li>
</ul>

<p>Please help me :) And sorry for my English.</p>
