How to link 2 menu buttons?

Hello! There are 2 types of menu, from the top and from the side. In the mobile version if you open both, the upper overlaps the menu on the side. So I wanted to link these menu. Ie if you open one menu, if you click on the other one should be closed. The top menu is made on bootstrap 4, and the side I did.
Can tell the algorithm work?
For example, conventional trigger'ohms.
April 7th 20 at 11:57
2 answers
April 7th 20 at 11:59
Solution
Add data-attribute when you open and give him some value, and then check and scribite
I tried, but when dynamically change the values if not taken into account, i.e., returns the old value - paula.Osinski70 commented on April 7th 20 at 12:02
@Mina_Kassulk, then check if you open the side menu, and then want to open the top then do check if the sidebar display block then hide it and open another - justen.Nol commented on April 7th 20 at 12:05
@abigale.Harber49How I do it) Thank you - paula.Osinski70 commented on April 7th 20 at 12:08
@abigale.Harber49, I need to contact You, write me in VK Anton or give your contacts. - kian_Considine commented on April 7th 20 at 12:11
@genoveva_Keeling, here mly telegrams: tyk - justen.Nol commented on April 7th 20 at 12:14
@abigale.Harber49, well, I really need to contact you, and you play with your toys - kian_Considine commented on April 7th 20 at 12:17
@abigale.Harber49, tyk - kian_Considine commented on April 7th 20 at 12:20
April 7th 20 at 12:01
$('.menu1 *').on('click', function(){
$('.menu2').hide();
});
Or are we talking about?

Find more questions by tags JavaScriptjQuery