Jquery Menu closer
<p>So i am working on this simple script which should hide any object when you have clicked outside of it.</p>

<p>Here is <a href="http://jsfiddle.net/9H2DR/" rel="nofollow"><strong>jsFiddle</strong></a> and my simple code:</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;div class="container"&gt;
    Click anywhere in this div

    &lt;div style="border:1px solid blue; float:right;"&gt;div should still open/close&lt;/div&gt;
&lt;/div&gt;

&lt;div class="close_me"&gt;Close me!&lt;/div&gt;​
</code></pre>

<p><strong>JS</strong></p>

<pre><code>$(".container").click(function(){
    $(".close_me").toggle();
});


helper_close(".close_me", ".container");

//this is simplified example of my function
function helper_close(target, avoid){
    //note that this function will be called once per object
    //so it should be fine to bind new event on document
    $(document).on("click", function(event){

        if( $(event.target).is(avoid) )
            return true;

        $(target).hide();
    });
}
</code></pre>

<p>​Now as you can see it works, (kind of) the problem is that <code>close_me</code> should also appear/disappear when you have clicked anywhere inside of <code>container</code>, which as you can see doesn't happen right now.</p>

<p>I know that i could just specify every object i want to "avoid" but what if i have 20 divs inside that container? Well the code would look very ugly... So i need some better way to do this.</p>
