jQuery: checking slideToggle visibility not working?
<p>I am trying to use slide toggle to show a sign in form and if they click outside of the box, I want that form to slide up.</p>

<p>I have everything running fine however my check for visibility isn't working and thus clicking outside the form container is not working.  Can you spot why?</p>

<pre><code>var loginForm = jQuery("#login .login-form");
jQuery("#login a").click(function(e) {
    e.preventDefault();
    loginForm.slideToggle();

});

// below check isn't working why?
if (jQuery(loginForm).is(":visible")) {
    jQuery("body").click(function() {
        jQuery(loginForm).slideUp();
    });
}
</code></pre>
