SideBar no close - Mobile / Tablet

1
Hey guys, Alright? hope so! Guys, I would like to know how it is done for the sidebar to go back as soon as a menu item is clicked.. Currently when you open the sidebar and click on a menu item... the page is loaded but it stays open... having to click again on the burger menu to close... Can anybody help me? https://cadastrobasicouf-sandbox.mxapps.io/preview/phone.html?profile=Phone - Mobile https://cadastrobasicouf-sandbox.mxapps.io/preview/tablet.html?profile=Tablet - Tablet Thank you!
asked
3 answers
1

What we have done in the past is added an HTML snippet with JavaScript code to cause the menu to collapse when clicked outside of that element. Note that if you use this method, the menu will close by clicking on anything outside of the menu, such as a popup that has been pulled in from the menu.  Here is some code from Stack Overflow that can help you out. 

 

$('body').click(function(event){
  // check if the clicked element is a descendent of navigation 
  if ($(event.target).closest('.navigation').length) { // replace .navigation with the class of the menu bar
    return; //do nothing if event target is within the navigation
  } else {
  // do something if the event target is outside the navigation
     $('.navigation').collapse() // replace .navigation with the class of the menu bar
  }
});

 

answered
1

Solution:
 

answered
1

Continuation.. 

 

answered