php - Twitter bootstrap accordion in accordion won't collapse -
i using twitter bootstrap create accordion in each row item contains yet accordion. code below creates accordion inside accordion, inner accordion won't collapse, , can't figure out why.
$daystobeshown: array(2) { [2]=> string(6) "wednesday" [6]=> string(7) "sunday" } $teamfordaysarray: array(2) { ["wednesday"]=> array(2) { [0]=> string(18) "09:00-09:30 (1022)" [1]=> string(18) "09:30-10:00 (1023)" } ["sunday"]=> array(1) { [0]=> string(18) "16:10-16:50 (2033)" } } <div class="accordion" id="accordion1"> <?php foreach($daystobeshown $key => $value) { ?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse<?php echo $key;?>"> <?php echo $value;?> </a> </div> <div id="collapse<?php echo $key;?>" class="accordion-body collapse"> <div class="accordion-inner"> <div class="accordion" id="accordion2"> <?php foreach($teamfordaysarray[$value] $keys => $valueinner) { ?> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse<?php echo $valueinner;?>"> <?php echo $valueinner;?> </a> </div> <div id="collapse<?php echo $valueinner;?>" class="accordion-body collapse" style="height: 0px;"> <div class="accordion-inner"> ... </div> </div> </div> <?php } ?> </div> </div> </div> </div> <?php } ?> </div>
so after additional testing, believe i've figured out problem. original id's contained spaces , brackets. once chose id without spaces , brackets, worked fine. i'm not entirely sure if spaces,brackets or both, made accoridion misbehave, suggest avoid using bootstrap accordion.
Comments
Post a Comment