Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Konrad Pilch
2,435 PointsCloning menu
Hi,
So i want to make a menu where when i scroll e.g. 300px down, the menu will appear again.
<!-- HEADER -->
<header>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<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="index.html" class="navbar-brand"> <i class="icon icon-adn"></i> </a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<div class="row">
<div class="col-md-5 col-md-offset-right-1">
<ul class="nav navbar-nav pull-right">
<li><a href="index.php">Home</a></li>
<li><a href="about.php">About</a></li>
<li><a href="">Blog</a></li>
</ul>
</div>
<div class="col-md-5 col-md-offset-1">
<ul class="nav navbar-nav pull-left">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Menu<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="menu-template.php">Indian</a></li>
<li><a href="menu-template.php">Chinese</a></li>
<li><a href="menu-template.php">Mexican</a></li>
<li><a href="drink-template.php">Drinks</a></li>
<li><a href="menu-template.php">Desserts</a></li>
</ul>
</li>
<li><a href="">Reservation</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div><!-- ofest -->
</div><!-- /row -->
</div><!-- container -->
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</header>
1 Answer
anil rahman
7,786 PointsYou can do scroll points in jquery to do a certain action when you scroll down or up or at a certain pixel point.
https://medium.com/@mariusc23/hide-header-on-scroll-down-show-on-scroll-up-67bbaae9a78c#.ncom2x6cr