"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:

我的鲸鱼太帅了 2015-03-14 00:56:24
    this is brilliant. thanks!
Абылайхан Байдуллаев 2015-06-03 04:02:39
    It doesn't work for me, may be I improperly attached to the view. Can you help me please?
我的鲸鱼太帅了 2015-06-03 08:01:10
    It's pretty straight forward. Did you include the javascript as well?
Абылайхан Байдуллаев 2015-06-04 08:11:46
    I'm new to web programming, I have included, but I don't know correctly is it or not. It shows me the panel list but I can't click and expand it. Can you show me the view file where you use this snippet. Thank you!
我的鲸鱼太帅了 2015-06-04 09:21:59
    Make sure you have the javascript for bootstrap as well as the expandable js.
Абылайхан Байдуллаев 2015-06-04 09:39:03
    good! it works after puting <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.co...">
我的鲸鱼太帅了 2015-06-04 09:46:46
    This is because all the codes you found here in Bootsnipp are snippets for website built using Bootstrap framework. Go here http://getbootstrap.com/ to learn more about Bootstrap. It makes life so much easier when developing a website.
Абылайхан Байдуллаев 2015-06-04 09:52:16
    Thank you very much) You helped me a lot)
我的鲸鱼太帅了 2015-06-04 09:54:44
    Sure no problem.

Commenting will be back soon.