"Collapsible Panel"
Bootstrap 3.1.0 Snippet by mattishere

<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="page-header"> <h1>CLI and REST</h1> </div> <div class="row"> <div class="col-md-6"> <div class="panel panel-primary"> <div class="panel-heading"> <h3 class="panel-title">Filer trySelector [name]</h3> <span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> <h3>trySelector 'Brauser'</h3> <hr> <pre> Running: Filer->trySelector(["BRAUSER"]) </pre> <pre> { "0001336508":"Brauser Michael", "0001346700":"Brauser Daniel" } </pre> <br><br> <h3>trySelector 'Facebook'</h3> <hr> <pre> Running: Filer->trySelector(["Facebook"]) Success: {"0001326801":"Facebook Inc"} </pre> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-success"> <div class="panel-heading"> <h3 class="panel-title">Filer isSeen [cik]</h3> <span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> <h3>trySelector 'Brauser'</h3> <hr> <pre> Running: Filer->isSeen(["0001336508"]) Success: [{"Filer":{"id":"82558","name":"Brauser Michael"}}] </pre> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="panel panel-info"> <div class="panel-heading"> <h3 class="panel-title">POST /rest_filers/selector.json</h3> <span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body"> <h3>POST</h3> <pre> { [ {"Brau"}, {"Braus"}, {"Brause"}, {"Brauser"} ] } </pre> </div> </div> </div> <div class="col-md-6"> <div class="panel panel-warning"> <div class="panel-heading"> <h3 class="panel-title">Panel 4</h3> <span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span> </div> <div class="panel-body">Panel content</div> </div> </div> </div> </div>
.row{ margin-top:40px; padding: 0 10px; } .clickable{ cursor: pointer; } .panel-heading span { margin-top: -20px; font-size: 15px; } h3 { margin: 0 auto; text-align: center; }
$(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-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'); } })

Related: See More


Questions / Comments: