Dismiss Menu when Focus is lost, not on mouseout. jQuery
<p>I have jQuery that drops a menu down when its parent is clicked on, and dismisses it when they hover away from the menu. I am wanting to change the behavior so that it only dismisses if they click somewhere else on the page, or a different menu. Is this possible?</p>

<pre><code>jQuery.fn.dropdown = function () {
    return this.each(function () {
        $('.ui-dropdown-list &gt; li &gt; a').click(function () {
            $(this).addClass("ui-dropdown-hover");
        });

        $("ul.ui-dropdown-list &gt; li &gt; a").click(function () {
            $(this).parent().find("ul").show();

            $(this).parent().hover(function () {
            }, function () {
                $(this).parent().find("ul").hide();
                $(this).find('&gt; a').removeClass("ui-dropdown-hover");
            });
        });
    });
};
</code></pre>
