下拉菜单在引导程序(4.0)中的原生方式不是动画的。我怎样才能让它像折叠时导航栏一样“滑动”打开?
值得注意的是,下拉菜单位于导航栏中。见下文代码; https://www.codeply.com/go/JKj5onR3ug
<nav class="navbar navbar-dark bg-dark">
<a class="navbar-brand" href="#">Never expand</a>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarsExample01" aria-controls="navbarsExample01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarsExample01" style="">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
<div class="dropdown-menu" aria-labelledby="dropdown01">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
</ul>
</div>
</nav>
原文由 Michael Ruta 发布,翻译遵循 CC BY-SA 4.0 许可协议
我喜欢这个。简单又好!