페이지 스크롤의 특정 지점에서 nav를 숨기고 표시하는 jquery가 있습니다. 유일한 문제는 navs 포스팅이 relative에서 fixed로 변경 될 때 페이지의 모든 내용을 nav가 있던 공간을 채우기 위해 위쪽으로 이동한다는 것입니다. 작동하는 솔루션을 찾을 수없는 것 같습니다. 이 일정 금액을 스크롤 한 후 fixed
을되기 전에div 표시/숨기기가 발생했습니다.
if ($(this).scrollTop() > 800) {
$('nav a').css({
"color": "#555"
});
$('header').css({
"position": "fixed",
"top": "0px",
"background": "white"
});
} else {
if ($(this).scrollTop() <= 800) {
$('nav a').css({
"color": "white"
});
$('header').css({
"position": "relative",
"top": "0px",
"background": "none"
});
}
}