html - Navbar not collapse on iPad [bootstrap 3] -
did responsive layout using bootstrap , working perfectly, when visit via ipad, navbar not collapse.
printscreen - preview on ipad:
http://i.stack.imgur.com/rjej0.jpg
below html / css code:
html:
<header class="header"> <div class="container"> <nav class="navbar navbar-inverse" role="navigation"> <div class="navbar-header"> <button type="button" id="nav-toggle" class="navbar-toggle" data-toggle="collapse" data-target="#main-nav"> <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="#" class="navbar-brand scroll-top logo"> <img src="assets/images/logo_cass_eventos.jpg"> </a> </div> <!--/.navbar-header--> <div id="main-nav" class="collapse navbar-collapse"> <ul class="nav navbar-nav" id="mainnav"> <li class="active"><a href="#" class="scroll-link">home</a></li> <li><a href="#" class="scroll-link">eventos empresariais</a></li> <li><a href="#" class="scroll-link">eventos sociais</a></li> <li><a href="#" class="scroll-link">leme gourmet</a></li> <li><a href="#" class="scroll-link">vĂdeos</a></li> <li><a href="#" class="scroll-link">depoimentos</a></li> <li><a href="#" class="scroll-link">imprensa</a></li> <li><a href="#" class="scroll-link">contato</a></li> </ul> </div> <!--/.navbar-collapse--> </nav> <!--/.navbar--> </div> <!--/.container--> </header>
css:
you need change navbar collapse breakpoint.
this example change 991px
@media (max-width: 991px) { .navbar-header { float: none; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin: 7.5px -15px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } .navbar-text { float: none; margin: 15px 0; } .navbar-collapse.collapse.in { display: block!important; } .collapsing { overflow: hidden!important; } }
Comments
Post a Comment