"QAC-963 - Full Clickable Panel Heading"
Bootstrap 3.1.0 Snippet by FriskyLingo

<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"> <h4>Manage Email Notifications</h4> <div class="row"> <div class="col-md-10"> <div class="panel panel-success"> <div class="panel-heading clickable"> <h3 class="panel-title"> Past-Due Follow-Up 7 days </h3> <span class="pull-right "><i class="glyphicon glyphicon-minus"></i></span> </div> <div class="panel-body"> PUT SOME STUFF IN HERE </div> </div> </div> </div> </div>
.clickable { cursor: pointer; } .clickable .glyphicon { background: rgba(0, 0, 0, 0.15); display: inline-block; padding: 6px 12px; border-radius: 4px } .panel-heading span { margin-top: -23px; font-size: 15px; margin-right: -9px; } a.clickable { color: inherit; } a.clickable:hover { text-decoration:none; }
$(document).on('click', '.panel-heading span.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-minus').addClass('glyphicon-plus'); } else { $this.parents('.panel').find('.panel-body').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-plus').addClass('glyphicon-minus'); } }); $(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-minus').addClass('glyphicon-plus'); } else { $this.parents('.panel').find('.panel-body').slideDown(); $this.removeClass('panel-collapsed'); $this.find('i').removeClass('glyphicon-plus').addClass('glyphicon-minus'); } }); $(document).ready(function () { $('.panel-heading span.clickable').click(); $('.panel div.clickable').click(); });

Related: See More


Questions / Comments: