From 3f694e4cb61a13c2394ffd84423e1cd5a37ac713 Mon Sep 17 00:00:00 2001 From: Patrick MacMannis Date: Mon, 6 Apr 2015 06:51:44 -0400 Subject: [PATCH] Added additional responsive menu close logic This commit adds JavaScript to close the responsive menu when a user clicks/taps outside of the open menu. --- js/agency.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/agency.js b/js/agency.js index 331f5c7..cedc097 100644 --- a/js/agency.js +++ b/js/agency.js @@ -24,3 +24,10 @@ $('body').scrollspy({ $('.navbar-collapse ul li a').click(function() { $('.navbar-toggle:visible').click(); }); + +// Closes the Responsive Menu on Click outside Menu +$('header, section, aside, footer').click(function() { + if(!$('button.navbar-toggle').hasClass('collapsed')) { + $('.navbar-toggle:visible').click(); + } +});