我试图将offcanvas添加到我的自举导航中,响应式工作完美但下载菜单在我尝试桌面分辨率时无效。
问题似乎是" bootstrap.offcanvas.js"。
当我删除" bootstrap.offcanvas.js"时,它可以正常工作。
有什么想法解决这个问题吗?
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container menu-height">
<div class="navbar-header">
<button type="button" class="navbar-toggle offcanvas-toggle pull-right" data-toggle="offcanvas" data-target="#js-bootstrap-offcanvas">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="https://www.irislink.com" class="navbar-brand"><object width="98px" data="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" title="xxxxxxxxxxxxxxxxxxxxxxxxxxxx" type="image/svg+xml"></object></a>
</div>
<!--/.navbar-header -->
<div class="navbar-offcanvas" id="js-bootstrap-offcanvas">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxxxxxx <b class="caret"></b></a>
<ul class="dropdown-menu" >
<li><a href="#">xxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxxxxx</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxxxxxx<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">xxxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxxx</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">xxxxx <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">xxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxxx</a></li>
<li class="divider"></li>
<li><a href="#">xxxxxx</a></li>
</ul>
</li>
<li class="responsive-online-shop"><div class="box-online-shop"><a class="nav-link btn btn-secondary-outline btn-secondary" href="xxxxxx">xxxxxx</a></div></li>
<li><div class="box-online-flag"><object data="xxxxxxxxxxxxx" type="image/svg+xml"></object><span class="flag-responsive hidden-lg">xxxxxxx</span></div></li>
</ul>
</div>
<!--/.navbar-collapse -->
</div>
</nav>
答案 0 :(得分:0)
&LT;
<nav class="navbar navbar-default navbar-offcanvas navbar-offcanvas-touch" role="navigation" id="js-bootstrap-offcanvas">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Brand</a>
</div>
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="js-dropdown-test">Another Link <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" id="js-dropdown-test2">Another Link <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
<li class="divider"></li>
<li><a href="#">One more separated link</a></li>
</ul>
</li>
</ul>
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a></li>
<li><a href="#">Another Link</a></li>
</ul>
</div>
</div>
</nav>
</header>
nav class =“navbar navbar-default navbar-offcanvas navbar-offcanvas-touch”role =“navigation”id =“js-bootstrap-offcanvas”&gt; 牌 链接