I am working with a one page site that is relying on jQuery Waypoints to reveal the side navigation once the user scrolls down a bit.
I currently have the menu appearing correctly but I need the menu to hide again once the user scrolls back up to the top, since there will be a main navigation located at the top of the page.
HTML:
<div id="side-nav" style="opacity: 0; ">
<ul class="cf">
<li><a href="#top">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#events">Events</a></li>
<li><a class="last" href="#stay">Stay</a></li>
</ul>
</div>
JS:
$(function () {
$('#side-nav').css('opacity', 0);
$('#side-nav').waypoint(function () {
$('#side-nav').animate({
opacity: 1
}, 'slow');
}, {
});
});
Fiddle: http://jsfiddle.net/GK6Mf/
Any help would be greatly appreciated.