如果它的孩子有一个“活动”类,我想让“数据管理”li默认打开。
JSfiddle 中的示例:
http://jsfiddle.net/MgcDU/5622/
HTML:
<div class="span4 well well-small">
<ul id="action-menu" class="nav nav-list">
<li class="nav-header">Navigation</li>
<li ><a href="<?php echo base_url();?>admin" class=""><i class="icon-th"></i> Overview </a></li>
<li>
<a href="#datamanagement-child" data-toggle="collapse"><i class="icon-book"></i> Data Management</a>
<ul id="datamanagement-child" class="nav nav-list collapse">
<li class="active"><a href="<?php base_url();?>admin/company" id="company-dm"><i class="icon-folder-close"></i> Company</a></li>
<li><a href="<?php base_url();?>admin/employee"><i class="icon-user"></i> Employee</a></li>
<li><a href="<?php base_url();?>admin/department"><i class="icon-home"></i> Department</a></li>
<li><a href="<?php echo base_url() . "admin/position";?>"><i class="icon-indent-right"></i> Position</a></li>
</ul>
</li>
<li>
<a href="#timekeeping-child" data-toggle="collapse"><i class="icon-time" ></i> Time keeping</a>
<ul id="timekeeping-child" class="nav nav-list collapse">
<li><a href="#"><i class="icon-edit"></i> Log employee</a></li>
<li><a href="#"><i class="icon-th-list"></i> Show logs</a></li>
</ul>
</li>
<li><a href="#"><i class="icon-briefcase"></i> Accounts</a></li>
<li><a href="#"><i class="icon-list-alt"></i> Reports</a></li>
<li class="divider"></li>
</ul>
</div>
我该怎么做?