Bootstrap Collapse/Expand with image -
collapse/expand work not properly. once collapse , expand 1 item , if expand one, first 1 gets collapsed again. images - + , vice versa not working.
please help.
<div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#info2"> <div class="row"> <div class="col-md-12"> <label class="bold">info 2 </label> <label class="aa-dark-red"> deferred 300300 sta dfw 24 mar 14 </label> <span class="pull-right"> <i class="glyphicon glyphicon-minus"></i></</span> </div> </div> </a> </div> </div> <div id="info2" class="panel-collapse collapse in"> <div class="pad-all"> <div class="row"> <div class="col-md-12 glyphicon glyphicon-pencil"> cont dfrl. mpn don't cross</div> </div> <div class="row pad-top aa-dark-gray"> <div class="col-md-2">eso</div> <div class="col-md-2">page</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">assy mpn</div> <div class="col-md-1"></div> </div> <div class="row aa-black"> <div class="col-md-2">2137625-02-67</div> <div class="col-md-2">10002g-0a</div> <div class="col-md-1">290</div> <div class="col-md-1">f0444636</div> <div class="col-md-1">300</div> <div class="col-md-1">f0418391</div> <div class="col-md-1">375</div> <div class="col-md-1">nas600-3</div> <div class="col-md-1">f0418316</div> <div class="col-md-1"></div> </div> </div> </div> </div> <!--info 3 --> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#info3"> <div class="row"> <div class="col-md-12"> <label class="bold">info 3 </label> <label class="aa-dark-red"> deferred 300300 sta dfw 24 mar 14 </label> <span class="pull-right"> <i class="glyphicon glyphicon-minus"></i></</span> </div> </div> </a> </div> </div> <div id="info3" class="panel-collapse collapse in"> <div class="pad-all"> <div class="row"> <div class="col-md-12 glyphicon glyphicon-pencil"> cont dfrl. mpn don't cross</div> </div> <div class="row pad-top aa-dark-gray"> <div class="col-md-2">eso</div> <div class="col-md-2">page</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">item</div> <div class="col-md-1">mpn</div> <div class="col-md-1">assy mpn</div> <div class="col-md-1"></div> </div> <div class="row aa-black"> <div class="col-md-2">2137625-02-67</div> <div class="col-md-2">10002g-0a</div> <div class="col-md-1">290</div> <div class="col-md-1">f0444636</div> <div class="col-md-1">300</div> <div class="col-md-1">f0418391</div> <div class="col-md-1">375</div> <div class="col-md-1">nas600-3</div> <div class="col-md-1">f0418316</div> <div class="col-md-1"></div> </div> </div> </div> </div> <!--info 4--> <div class="panel panel-default"> <div class="panel-heading"> <div class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#info4"> <div class="row"> <div class="col-md-12"> <label class="bold">info 4 </label> <label class="aa-dark-blue"> atbt : replace tray table assy mpn f0444636 cpn tab1078 1ea on aog lax vendor </label> <span class="pull-right"> <i class="glyphicon glyphicon-minus"></i></</span> </div> </div> </a> </div> </div> <div id="info4" class="panel-collapse collapse in pad-all"> <div class="row aa-dark-gray"> <div class="col-md-2">date</div> <div class="col-md-2">name</div> <div class="col-md-8"></div> </div> <div class="row aa-black"> <div class="col-md-2">17 apr/ftw</div> <div class="col-md-2">a tech 847383</div> <div class="col-md-8"></div> </div> </div> </div> <!--info 5 --> <div class="panel panel-default"> <div class="panel-heading bg-dark-gray"> <div class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#info5"> <div class="row"> <div class="col-md-12"> <label class="bold aa-green"> closed : corrected 732838 sta lax 18 apr 14 </label> <span class="pull-right"> <i class="glyphicon glyphicon-minus"></i></</span> </div> </div> </a> </div> </div> <div id="info5" class="panel-collapse collapse in"> <div class="pad-all"> <div class="row"> <div class="col-md-12 glyphicon glyphicon-pencil"> removed , replaced 15g tray table per amm 25-25-03 operational check normal cleared mic sheet.</div> </div> </div> </div> </div> </div>
jquery code -
$(document).ready(function () { $('#panel-collapse').on('shown', function () { $(this).parent("div").find(".glyphicon glyphicon-minus") .removeclass(".glyphicon glyphicon-minus").addclass(".glyphicon glyphicon-plus"); }); $('div.panel-collapse').on('hidden', function () { $(this).parent("div").find(".glyphicon glyphicon-plus") .removeclass(".glyphicon glyphicon-plus").addclass(".glyphicon glyphicon-minus"); }); });
Comments
Post a Comment