You can add a listener to the document (since the event is bubbling up, you can write it to the parent)
$(function() { $("#header-translate ul li").click(function() { $("#header-translate li ul").toggle("slide", { direction: "up" }, 500); $(document).one('click', function(){ $("#header-translate li ul").hide(); }); }); });
source share