简体   繁体   中英

Bootstrap Navbar Expand/collapse mobile without JavaScript

How can I implement Bootstrap Navbar Expand/collapse mobile without JavaScript? I try like below but when I deactivate javascript from Browser, the Hamburger Menu is no more working.

<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 &amp;     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>

many thanks in advance.

bootstrap navbar基于JavaScript,因此您必须启用javascript才能执行此操作,但是可以搜索CSS navbar, http://codepen.io/Akhilr/pen/xwEvQz

like this http://codepen.io/Akhilr/pen/xwEvQz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM