如何在没有JavaScript的情况下实现Bootstrap Navbar展开/折叠移动设备? 我尝试如下,但是当我从浏览器停用javascript时,汉堡菜单不再有效。
<div class="container-fluid" id="page">
<div class="sidebar span3">
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<style><input:checked + .nav-collapse {height: auto;}</style>
<a>
<label class="btn btn-navbar" for="checkbox">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</label>
</a>
<input type="checkbox" id="checkbox" style="position: absolute; opacity:0;" />
<a href="/dictionary/site/index" class="brand">Dictionary</a>
<div class="nav-collapse" />
<ul class="nav">
<li class="active"><a href="/dictionary/site/index">Search</a></li>
<li><a href="/dictionary/site/page?view=phrases">Phrases</a></li>
<li><a href="/dictionary/site/page?view=Tools_Downloads">Tools & Downloads</a></li>
<li><a href="/dictionary/site/page?view=news">News</a></li>
<li><a href="/dictionary/about">About</a></li>
<li><a href="/dictionary/site/contact">Contact</a></li>
<li><a href="/dictionary/site/page?view=links">Links</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
提前多多感谢。
答案 0 :(得分:0)
bootstrap navbar基于JavaScript,因此如果不启用javascript就无法执行此操作,但您可以搜索css导航栏,http://codepen.io/Akhilr/pen/xwEvQz
like this http://codepen.io/Akhilr/pen/xwEvQz