"Expandable Panel List"
Bootstrap 3.1.0 Snippet by dylanjacob

<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"> <div class="container"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Panel List Group with Expandable Setail Section</h3> </div> <ul class="list-group"> <li class="list-group-item"> <div class="row toggle" id="dropdown-detail-1" data-toggle="detail-1"> <div class="col-xs-10"> Item 1 </div> <div class="col-xs-2"><i class="fa fa-chevron-down pull-right"></i></div> </div> <div id="detail-1"> <hr></hr> <div class="container"> <div class="fluid-row"> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </div> </div> </div> </li> <li class="list-group-item"> <div class="row toggle" id="dropdown-detail-2" data-toggle="detail-2"> <div class="col-xs-10"> Item 2 </div> <div class="col-xs-2"><i class="fa fa-chevron-down pull-right"></i></div> </div> <div id="detail-2"> <hr></hr> <div class="container"> <div class="fluid-row"> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </div> </div> </div> </li> <li class="list-group-item"> <div class="row toggle" id="dropdown-detail-3" data-toggle="detail-3"> <div class="col-xs-10"> Item 3 </div> <div class="col-xs-2"><i class="fa fa-chevron-down pull-right"></i></div> </div> <div id="detail-3"> <hr></hr> <div class="container"> <div class="fluid-row"> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> <div class="col-xs-1"> Detail: </div> <div class="col-xs-5"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. </div> </div> </div> </div> </li> </ul> </div> </div>
$(document).ready(function() { $('[id^=detail-]').hide(); $('.toggle').click(function() { $input = $( this ); $target = $('#'+$input.attr('data-toggle')); $target.slideToggle(); }); });

Similar snippets: See More


Comments:

comments powered by Disqus