我有一个项目正在使用引导程序
3.3.7
. 我需要在导航栏中添加下拉菜单。
我想我得到了正确的标记。但是,下拉菜单没有按预期显示。
这是我的密码
<nav class="navbar navbar-inverse navbar-fixed-top sticky-top" >
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">
Business Name
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown notification-container">
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Notifications
<span class="notification-count badge">3</span>
</a>
<ul class="dropdown-menu dropdown-backdrop" style="width: 240px;">
<li class="p-2 border-bottom notification-message message-unread">
<a href="#"><small>Message 1</small></a>
</li>
<li class="p-2 border-bottom notification-message message-unread">
<a href="#"><small>Message 2</small></a>
</li>
<li class="p-2 border-bottom notification-message message-unread">
<a href="#"><small>Message 3</small></a>
</li>
</ul>
</li>
<li class="nav-item">
<div class="navbar-text mr-3 ml-1" style="margin-right: 12px; margin-left: 4px; "> Hello, Jake!</div>
</li>
</ul>
</div>
<!--/.navbar-collapse -->
</div>
</nav>
我还用代码创建了一个小提琴手来显示右上角的通知菜单在单击时如何不显示项目。
https://jsfiddle.net/tsjLhvz2/
如何打开导航栏中的菜单?