2
I created two buttons Collapse in Bootstrap with two different contents.
What happens:
When I click the first button the content expands. When I click the second button the second content expands below.
What I wanted:
I wanted when I clicked on the first button the content would open as it already does, but when I clicked on the second button the contents of the first one would close leaving only the second content.
<div class="container">
<div class="row justify-content-md-center">
<div class="col-sm-12 col-md-12 col-lg-3 col-xl-3 margem-baixa-5">
<button type="button" class="btn btn-outline-primary btn-block btn-vert" data-toggle="collapse" href="#jan-cor-2f" aria-expanded="false">Abrir: 2 Folhas</button>
</div>
<div class="col-sm-12 col-md-12 col-lg-3 col-xl-3 margem-baixa-5">
<button type="button" class="btn btn-outline-primary btn-block btn-vert" data-toggle="collapse" href="#jan-cor-3f" aria-expanded="false">Abrir: 3 Folhas</button>
</div>
</div>
</div>
<div class="collapse" id="jan-cor-2f">
<div class="container">
<div class="row" align="center">
<?php include"pages/ecommece/inc/jan-cor/2f-ven/jan-cor-2f-ven-1500x800.php"; ?>
<?php include"pages/ecommece/inc/jan-cor/2f-ven/jan-cor-2f-ven-1500x1000.php"; ?>
</div>
</div>
</div>
<div class="collapse" id="jan-cor-3f">
<div class="container">
<div class="row" align="center">
<?php include"pages/ecommece/inc/jan-cor/3f/jan-cor-3f-1500x800.php"; ?>
<?php include"pages/ecommece/inc/jan-cor/3f/jan-cor-3f-1500x1000.php"; ?>
</div>
</div>
</div>
</div>
but where I put it and how I do it, I’m new to php, and have no knowledge in jquery
– Bruno Rosa
@Brunorosa add a <script> tag on the footer of your page, and don’t forget to link to the Jquery library, here’s how to do it right: https://www.w3schools.com/jquery/jquery_get_started.asp
– Patrick Oliveira