0
In the project I’m doing, when the viewport is less than 767px it will display a menu/navbar however, it should only be displayed after a certain section of the page.
I made an example in Fiddle, there is better explained.
Section 1 - Does not display
Section 2 (Onwards) - Displays.
HTML:
<nav class="navbar navbar-default navbar-fixed-bottom visible-xs"> <div class="container-fluid">
<div class="navbar-header">
<!-- <a class="navbar-brand" href="#">LOGO PSTCH</a> </div> -->
<div class="collapse navbar-collapse visible-xs" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="#" data-toggle="modal" data-target="#myModal1" data-direction="bottom"> About</a></li>
<li><a href="#" data-toggle="modal" data-target="#myModal2" data-direction='bottom'> Sobre </a></li>
<li><a href="#" data-toggle="modal" data-target="#myModal3" data-direction='bottom'> Contact </a></li>
</ul>
</div>
</div> </div> </nav>
<div id="logo">
<center>
<a href="#desce" class="page-scroll btn btn-xl">SECTION 1</a>
</center> </div>
<div id="content">
<p> SECTION 2 </p>
<p> The navbar will appear here down/hereafter!</p> </div>
CSS:
html, body {
height:100%;
padding:0;
margin:0;
}
#logo{
background: black;
width: 100%;
height: 100%;
}
#content {
border: 1px solid black;
width: 100%;
height: 50%;
}
.navbar .nav li{
float:none;
display:inline-block;
*display:inline; /* Internet Explorer 7 compatibility */
*zoom:1;
vertical-align: bottom;
}
.navbar .navbar-collapse {
text-align: center;
}
Do you want the navbar to track the user’s scroll or it to be fixed at the beginning of the white area there? I couldn’t understand.
– Huskell
Fixed on the footer. Exactly as it is there. What I want is that: When the user is in Section 1 (box with black background) the navbar is hidden! If I leave Section 1 and go to Section 2, the navbar should appear.. and so on, you understand?
– Zkk