0
I wish that when I click on one of the menus Collapse the others hide and I’m not getting, I’m using the following code in jquery, I don’t know if it’s right:
$( ".card" ).on( "click", "#menu_arrow", function() {
$( "div[class|='collapse']" ).removeClass('show');
});
The menus are in a php loop that displays users along with this little menuzinho on the side of the name:
<div class="right-col col-lg-4 align-self-center align-items-center">
<a data-toggle="collapse" data-parent="#accordion" id="menu_arrow" href="#collapse<?php echo $matricula['id']; ?>" aria-expanded="true" aria-controls="collapse<?php echo $matricula['id']; ?>">Menu de opções <i class="fa fa-caret-down" id="caret2" aria-hidden="true"></i></a>
<div id="collapse<?php echo $matricula['id']; ?>" class="collapse hide" role="tabpanel" aria-labelledby="heading<?php echo $matricula['id']; ?>">
<div class="opt"><a href="<?php echo $url_base . "/painel/editar_usuarios.php?id=" . $matricula['id']; ?>"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> Editar cadastro</a></div>
<div class="opt"><a href="#"><i class="fa fa-list-alt" aria-hidden="true"></i> Editar boletim</a></div>
<div class="opt"><a href="#"><i class="fa fa-file-text" aria-hidden="true"></i> Imprimir histórico</a></div>
<div class="opt"><a href="#"><i class="fa fa-file-text" aria-hidden="true"></i> Imprimir ficha</a></div>
<div class="opt"><a href="#"><i class="fa fa-folder" aria-hidden="true"></i> Portifólio</a></div>
</div>
</div>
Your answer didn’t solve my problem, but it helped me solve it, so thank you.
– Leandro Silva Campos