On my website, I have a search filter on the homepage that brings you to the products page when you click checkboxes and search.
The accordion works fine if you go to the products page right away without using the homepage's search filter. However when you use the search, the accordion will open automatically (which is what I want) but when you click the title of the accordion to push it back up, it refreshes itself instead and it collapses once again (it thinks the default accordion is on hide, so it's trying to collapse it), which results in me having to click it twice to hide the content (after the initial double click, it goes back to normal).
This is the visual: (when you click search and it navigates you to the products page)
Then when you try to close the accordion, let's say the Color, It will do this:
... (pushes back up/hides it for a split second)
<div class="col-md-12 panelcollapseaccordion">
<div class="panel-group" >
<div class="panel panel-default">
<a class="panel-default" data-toggle="collapse" data-parent="#accordion2" href="#collapseOne">
<div class="panel-heading">
<h4 class="panel-title">
Gender
</h4>
</div>
</a>
<div id="collapseOne" class="panel-collapse collapse <?php if($gender_check){echo "filtereditems";} ?>" >
<div class="panel-body">
<dl class="gender-list">
<dt><label><input type="checkbox" class="filterbox gender_filter" value="F" <?php if(in_array('F', $model->selected_genders)){echo "checked='checked'";} ?>/>Female</label></dt>
<dt><label><input type="checkbox" class="filterbox gender_filter" value="M" <?php if(in_array('M', $model->selected_genders)){echo "checked='checked'";} ?>/>Male</label></dt>
</dl>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-12 panelcollapseaccordion">
<div class="panel-group" >
<div class="panel panel-default">
<a class="panel-default" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo">
<div class="panel-heading">
<h4 class="panel-title">
Brand
</h4>
</div>
</a>
<div id="collapseTwo" class="panel-collapse collapse
<?php if($brand_check) {echo "filtereditems";} ?>">
<div class="panel-body">
<dl class="brand-list">
<?php foreach($brands as $brand){ ?>
<dt><label><input type="checkbox" class="filterbox brand_filter" value="<?php echo $brand->name; ?>" <?php if(in_array($brand->name, $model->selected_brands)){echo "checked='checked'";} ?>/><?= $brand->name ?></label></dt>
<?php } ?>
</dl>
</div>
</div>
</div>
</div>
</div>
Help please.. :(