【发布时间】:2018-04-02 23:49:35
【问题描述】:
我想知道是否有人可以帮助解决这个问题,我将不胜感激。为什么我的导航栏没有出现在我的website 上?我查看了我的 HTML、CSS 和 JS,但似乎无法确定问题所在。这是我的 GitHub 网站 link. 我相信问题可能出在 JS 上。
JS
var scroll = new SmoothScroll('a[href*="#"]');
jQuery(document).ready(function($) {
$(document).on("scroll", function() {
const features_top = $(".features-icons").position().top;
const top_of_window = $(window).scrollTop();
if (top_of_window >= features_top) {
$('.navbar').css('display', 'flex') // display: flex
} else {
$(".navbar").hide();
}
});
}); // This is just a sample script. Paste your real code (javascript or HTML) here.
if ('this_is' == /an_example/) {
of_beautifier();
} else {
var a = b ? (c % d) : e[f];
}
【问题讨论】:
-
目前我无法查看该网站,但您能否将 CSS
position: fixed用于导航栏? -
导航栏应该在用户向下滚动到功能图标部分时出现。不在首页的网站顶部。
标签: javascript html css