I have a simple dropdown menu that works nicely but is there a way so that if you click anywhere but the ul it will toggle it closed again?
Jquery
$('.header').click(function() {
    $('.menu').toggle();
});
HTML
<a class="header" href="#">All</a>
<ul class="menu">
    <li>All</li>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
</ul>
 
     
    