Slide Up on click on body when the element is shown

Slide Up on click on body when the element is shown

This is my code I need to Slide up the menu when the user clicks on any part of the body. 

$('.show-menu').click(function(event) {
event.preventDefault();
$(this).addClass('active');
$(this).next('.menu-filter').slideDown(300);
});
if($('.menu-filter').is(':visible')){
$('body').click(function(event) {
event.preventDefault();
$('.show-menu').removeClass('active');
$('.menu-filter').slideUp(300);
});
}