1
I have two modals, only I’m not getting one to close automatically when the other one is opened, what I’ve got so far is 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 modal 01 has opened, I click to open to 02, 01 has to close automatically, and vice versa
The rest of the code is missing to open the modals.
– Sam
@Sam with this they already open perfectly. only that if I click on the two buttons, the two are open, one does not close to the other open understood?
– goio