我使用Bootstrap4制作导航栏,当我打开网站时,菜单中的移动屏幕链接无效。这是我的代码:
<nav class="navbar navbar-expand-sm navbar-dark" style="background-color: #E2BA28">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-content" aria-controls="nav-content" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Brand -->
<a class="navbar-brand" href="https://www.example.com"><img src="logo" width="60" class="d-inline-block align-top" alt=""></a>
<!-- Links -->
<div class="collapse navbar-collapse justify-content-end" id="nav-content">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link eak-link" href="https://www.example.com">example</a>
</li>
<li class="nav-item">
<a class="nav-link eak-link" href="https://www.example.com">example</a>
</li>
<li class="nav-item">
<a class="nav-link eak-link" href="#">example</a>
</li>
<li class="nav-item">
<a class="nav-link eak-link" href="https://www.example.com">example</a>
</li>
<li class="nav-item">
<a class="nav-link eak-link eak-abc" href="https://www.example.com">example</a>
</li>
</ul>
</nav>
如果确实有帮助我正在使用这个js:
$(document).ready(function(){
$('.nav-item').hover(function(){
$(this).toggleClass('animated bounceIn')
});
});
感谢您的帮助!