gpt4 book ai didi

jquery - Bootstrap 3 的关闭 Canvas (滑过)菜单

转载 作者:行者123 更新时间:2023-12-01 07:10:55 26 4
gpt4 key购买 nike

所以我试图在我的导航中实现 Canvas 外菜单。我只是无法用 http://getbootstrap.com/examples/offcanvas/ 给出的代码完全弄清楚这一点。

当屏幕宽度低于 991px 时,单击菜单(或汉堡包)图标时,顶部链接应出现在垂直列表中。我希望垂直列表能够在内容上滑动,以便菜单图标在某种程度上仍然可见。所以不是插入效应。

我所描述的一个很好的例子是此网站上的“Slide In On Top”过渡 http://tympanus.net/Development/SidebarTransitions/

这是我的导航栏的引导页。 http://www.bootply.com/r8RRCqHo9J

导航

<header class="navbar navbar-inverse navbar-static-top" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><img class="img-responsive" src="http://placehold.it/234x84&text=LOGO" alt="..." style="padding:18px 5px"></a>
</div>
<nav class="collapse navbar-collapse" role="navigation">
<ul class="nav navbar-nav navbar-inverse">

<li class="active">
<a href="#">Home</a>
</li>

<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Link 1</a>
<ul class="dropdown-menu">
<li class="drop-down"><a href="#">Sub-Item 1</a></li>
<li class="drop-down"><a href="#">Sub-Item 2</a></li>
<li class="drop-down"><a href="#">Sub-Item 3</a></li>
<li class="drop-down"><a href="#">Sub-Item 4</a></li>
</ul>
</li>

<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Link 2</a>
<ul class="dropdown-menu">
<li class="drop-down"><a href="#">Sub-Item 1</a></li>
<li class="drop-down"><a href="#">Sub-Item 2</a></li>
</ul>
</li>

<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Link 3</a>
<ul class="dropdown-menu">
<li class="drop-down"><a href="#">Sub-Item 1</a></li>
<li class="drop-down"><a href="#">Sub-Item 2</a></li>
</ul>
</li>

<li>
<a href="#">Link 4</a>
</li>

<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Link 5</a>
<ul class="dropdown-menu">
<li class="drop-down"><a href="#">Sub-Item 1</a></li>
<li class="drop-down"><a href="#">Sub-Item 2</a></li>
<li class="drop-down"><a href="#">Sub-Item 3</a></li>
</ul>
</li>


</ul>
</nav>
</div>
</header>

最佳答案

您只需将 navbar-static-top 更改为 navbar-fixed-top 并向正文添加填充。检查此引导层:http://www.bootply.com/X2s18rcAdN

<小时/>

更新:

工作解决方案:http://jsbin.com/yuxesupixu/1/edit?html,css,js

基于Christina所做的伟大工作: https://stackoverflow.com/a/20864689/1004312

关于jquery - Bootstrap 3 的关闭 Canvas (滑过)菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27299804/

26 4 0