【发布时间】:2016-11-03 11:36:43
【问题描述】:
这是我目前拥有的,但正如你所看到的 (www.lucasdebelder.be),导航在滚动后一直隐藏到 200 像素,但我有点想改变它。通过让导航在开始时显示,但在滚动 200 像素之后,更改颜色(背景颜色和颜色)。我将尝试通过图片和示例来展示我想要的内容。
So this is what it should look like upon entering on the website.
And then if you scroll down it should transform into this.
这就是我的 jquery 在 atm 的样子。
(function($) {
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 200) {
$('nav').fadeIn(500);
} else {
$('nav').fadeOut(500);
}
});
});
})(jQuery);
【问题讨论】:
标签: jquery html css scroll navigation