"Full Clickable Panel Heading"
Bootstrap 3.1.0 Snippet by ottster

<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading clickable"> <h3 class="panel-title"> Upcomming Events</h3> <span class="pull-right "><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> Panel content <a href="http://www.jquery2dotnet.com/2014/01/static-social-button-with-animation.html">Static Social Button With Animation</a></div> </div> </div> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading clickable red"> <h3 class="panel-title"> Upcomming Events</h3> <span class="pull-right "><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> Panel content <a href="http://www.jquery2dotnet.com/2014/01/static-social-button-with-animation.html">Static Social Button With Animation</a></div> </div> </div> <div class="col-md-12"> <div class="panel panel-primary"> <div class="panel-heading clickable"> <h3 class="panel-title"> Upcomming Events</h3> <span class="pull-right "><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> Panel content <a href="http://www.jquery2dotnet.com/2014/01/static-social-button-with-animation.html">Static Social Button With Animation</a></div> </div> </div> </div> </div>
.clickable { cursor: pointer; } .clickable .glyphicon { background: rgba(0, 0, 0, 0); display: inline-block; padding: 6px 12px; border-radius: 4px } .panel{ margin-bottom:0px; } .panel-heading { padding: 15px 15px; } .panel-primary>.panel-heading { border:none; box-shadow:none; border-radius: 0; } .panel-primary>.panel-heading { color: #fff; background-color: #3855b5; border-color: #3855b5; } .panel-primary { border:none; } .panel-heading span { margin-top: -23px; font-size: 15px; margin-right: -9px; } a.clickable { color: inherit; } a.clickable:hover { text-decoration:none; } .red{ background:#fc4568 !important; }
$(document).on('click', '.panel div.clickable', function (e) { var $this = $(this); if (!$this.hasClass('panel-collapsed')) { $this.parents('.panel').find('.panel-body').slideUp(); $this.addClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); } else { $this.parents('.panel').find('.panel-body').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); } }); $(document).ready(function () { $('.panel-heading span.clickable').click(); $('.panel div.clickable').click(); });

Related: See More


Questions / Comments: