使用多级下拉菜单显示产品类别:
<div class="dropdown"> <a href="#" id="category_name" class="dropdown-toggle selected_category" data-toggle="dropdown" aria-expanded="true"> <i class="fa fa-list-ul" aria-hidden="true"></i><span>All Category </span> <span class="glyphicon glyphicon-triangle-bottom"></span></a>
<ul class="dropdown-menu multi-level">
@foreach($main_categories as $main_category)
<li id="{{$main_category}}" class="dropdown-submenu main_category"> <a class="maincategory" tabindex="-1" href="#">{{$main_category}}</a>
<ul class="dropdown-menu">
<li class="dropdown-submenu" id="subcat{{$main_category}}">
<ul class="dropdown-menu">
<li><a href="#">All</a></li>
<li><a href="#">Boot Cut</a></li>
<li><a href="#">Capri</a></li>
<li><a href="#">Straight Leg</a></li>
<li><a href="#">Skinny</a></li>
<li><a href="#">Ankle/Cropped</a></li>
<li><a href="#">Boyfriend</a></li>
<li><a href="#">Overalls</a></li>
<li><a href="#">Wide Leg/Flare</a></li>
<li><a href="#">Relaxed</a></li>
<li><a href="#">Mid-rise</a></li>
<li><a href="#">Low-rise</a></li>
<li><a href="#">Hi-rise</a></li>
<li><a href="#">Easy Boot</a></li>
</ul>
</li>
</ul>
</li>
@endforeach
</ul>
</div>
当我选择Men时,它会重定向到包含Men产品的页面。但下拉列表会更改为All Category。如何将其作为选定的选项?