-1
The above code works as an accordion, is the same as the accordion code of Bootstrap. I wonder, how to do user by clicking on "Panel-Heading", he stick to the green background, and when back stay with the white background without affecting the Heading from below. That is: Before clicking it will be with the white background. After that click will have the green background.
<head>
<!-- CSS only -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<!-- JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</head>
<body>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
<div class="row">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
</div>
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse">
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="card">
<div class="card-body">
<h5 class="card-title" style="text-align: center">Reclamações abertas</h5>
<p class="card-text" style="text-align: center">5 vendas</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
Paul could be more specific in his question because I see three situations that might make sense with his example but I don’t know which to present.
– Augusto Vasques
By clicking to expand, change the color of the panel-Heading, and when to shrink the color return to normal
– Paulo