#web-nav {
display: none;
}
#mobile-nav {
width: 100%;
background: url(img/menu-bg.png) repeat;
height: 70px;
display: block;
position: fixed;
z-index: 50;
top: 0px;
}

<nav id="mobile-nav">
<a href="index.html">
<img class="logo" src="admin/wp-content/themes/mame/assets/img/sicklehammer.png" />
</a>
<img class="drop-nav" src="open.png" />
</nav>
<nav id="mobile-expand">
<img class="logo" src="logo.png" />
<img class="close" src="img/close.png" />
<div id="hidden-nav">
</div>
<ul id="menu">
<li><a href="index.html">Home</a>
</li>
<li><a href="work/index.html">Work</a>
</li>
<li><a href="about/index.html">About</a>
</li>
<li><a href="blog/index.html">Blog</a>
</li>
<li><a href="contact/index.html">Contact</a>
</li>
<ul class="work-subs">
<li><a href="/index.html">Movies</a>
</li>
<li><a href="/index.html">Photos</a>
</li>
</ul>
</ul>
</nav>
&#13;
答案 0 :(得分:1)
这就是我使用的
<script> $('#main-nav').hide();
$(window).scroll(function () {
if ($(this).scrollTop() > 750)
{
$('#main-nav').fadeIn();
}
else
{
$('#main-nav').fadeOut();
}
});