2
HTML
<!-- panel 1 -->
<div class="panel panel-default pulse animated">
<div class="panel-heading" role="tab">
<h1 class="panel-title">
<a id="link-open" class="text-pan collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
<center><i class="glyphicon glyphicon-map-marker gly-circle"></i></center>
<h2 id="title-cat">TÍTULO 01</h2>
</a>
</h1>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body" id="panel-mob">
<div class="thumbnail">
<img data-src="holder.js/100%x200" alt="100%x200" src="imagens/background/screens-mob/bg-mob-one.jpg" />
<div class="caption-mob panel-body">
<h3 class="caption-title-mob animated fadeInDown">TÍTULO 01</h3>
<p class="caption-text-mob animated fadeInDown">texto aqui</p>
<a href="petbusca/pet.html" class="btn btn-success btn-lg btn-config btn-mob"><span class="animated rubberBand">acessar »</span></a>
</div>
</div>
</div>
</div>
</div>
<!-- / panel 1 -->
<!-- panel 2 -->
<div class="panel panel-default pulse animated">
<div class="panel-heading" role="tab">
<h1 class="panel-title">
<a id="link-open-two" class="text-pan collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
<center><i class="glyphicon glyphicon-home gly-circle"></i></center>
<h2 id="title-cat">TITULO</h2>
</a>
</h1>
</div>
<div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
<div class="panel-body" id="panel-mob">
<div class="thumbnail">
<img data-src="holder.js/100%x200" alt="100%x200" src="imagens/background/screens-mob/bg-mob-two.jpg" />
<div class="caption-mob panel-body">
<h3 class="caption-title-mob animated fadeInDown">TÍTULO 02</h3>
<p class="caption-text-mob animated fadeInDown">TEXTO AQUI</p>
<a href="vetemcasa/vet.html" class="btn btn-success btn-lg btn-config btn-mob"><span class="animated rubberBand">acessar »</span></a>
</div>
</div>
</div>
</div>
</div>
<!-- / panel 2 -->
</div>
The above code acts as an accordion, it is the same code as the Bootstrap accordion. I would like to know, how to make the user by clicking on the "Panel-Heading", he stay with the green background, and when he comes back stay with the white background, without affecting the Heading from below. That is to say:
- Before clicking it will be with the white background.
- After you click you will have the green background.
- By clicking again on the link (Heading) to close the same after opened, or clicking on the Heading 2 panel, it will stay with the white background again, and in case the user happens to click on the Heading link from panel 2, it will run the same things as link 1 from the first panel-Heading. that the link of accordion one, and vice versa.