我正試圖實現this。但迄今爲止我還沒有成功。我的代碼如下。它有什麼問題?HTML JS - 子菜單不工作?
HTML:
<nav id="bt-menu" class="bt-menu">
<a href="#" class="bt-menu-trigger" id="bt-icon icon-gplus" ><br><span>Menu
<ul >
<li style="text-align:center;"><a href="index.php"><span>DashBoard</span></a></li>
<li style="text-align:center;"><a href="user.php"><span>User </span></a></li>
<li style="text-align:center;"><a href="candidates.php"><span>Candidates</span></a></li>
<li style="text-align:center;"><a href="party.php"><span>Partylist</span></a></li>
<li style="text-align:center;"><a href="position.php"><span>Position</span></a></li>
<li style="text-align:center;"><a href="program.php"><span>Program</span></a></li>
<li style="text-align:center;"><a href="department.php"><span>Department</span></a></li>
<li style="text-align:center;"class="active"><a href="syear.php"><span>School-Year</span></a></li>
<li style="text-align:center;"><a href="reports.php"><span>Reports</span></a></li>
<li style="text-align:center;"><a href="#"><span>Logs</span></a>
<ul class="sub-menu" style="text-align:right">
<li><a href="#" style="text-align:right;">Submenu</a></li>
</ul></li>
</ul>
</nav>
的Javascript:
<script type="text/javascript">
$('li a').click(
function() {
$(this).next().slideToggle();
})
</script>
你'BT-菜單trigger'和跨度沒有關閉標籤 – dann