I have two modalities, so I can not automatically close it when the other one is opened, what I got up to now was to do this
CSS
.mr{
position: fixed;
top: 0px;
left: -15%;
background-color: #fff;
padding: 1% 1%;
width: 15%;
height: 100vh;
transition: .3s;
z-index: 9999;
box-shadow: 0 0 15px #ccc;
}
.show{left: 0px;}
HTML
<a href="javascript:void(0)" class="btGeneros"><i class="fas fa-folder-open"></i></a>
<button class="btFiltro"><span></span></button>
<div class="menuG mr">
<div class="subMenu">
01
</div>
</div>
<div class="menuF mr">
<div class="subMenu">
02
</div>
</div>
JQUERY
$(document).ready(function(){
$('.btFiltro').click(function(){
$('.menuF').toggleClass('show');
$('.btFiltro').toggleClass('toggle');
$('.btFiltro').toggleClass('black');
})
$('.btGeneros').click(function(){
$('.menuG').toggleClass('show');
$('.btGeneros').toggleClass('toggle');
$('.btGeneros').toggleClass('black');
})
})
When mode 01 has opened, I click to open the 02, the 01 has to close automatically, and vice versa