js header
This commit is contained in:
parent
72c2c9ff59
commit
46c3afcd53
File diff suppressed because one or more lines are too long
|
@ -371,6 +371,9 @@ header .header_nav_container.hidden {
|
||||||
header .header_nav_container.visible {
|
header .header_nav_container.visible {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
header .header:hover + .header_nav_container {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
|
|
@ -38,6 +38,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
//////// header ////////////
|
//////// header ////////////
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const headerNavContainer = document.querySelector('.header_nav_container');
|
const headerNavContainer = document.querySelector('.header_nav_container');
|
||||||
let lastScrollTop = 0;
|
let lastScrollTop = 0;
|
||||||
|
@ -81,6 +83,18 @@
|
||||||
window.addEventListener('scroll', function() {
|
window.addEventListener('scroll', function() {
|
||||||
handleScroll();
|
handleScroll();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const headerLeftContainer = document.querySelector('header');
|
||||||
|
headerLeftContainer.addEventListener('mouseenter', function() {
|
||||||
|
slideIn(); // Slide out on mouse enter
|
||||||
|
});
|
||||||
|
|
||||||
|
headerLeftContainer.addEventListener('mouseleave', function() {
|
||||||
|
if (lastScrollTop <= threshold) {
|
||||||
|
slideOut(); // Slide in on mouse leave if not scrolled down
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -160,4 +160,7 @@ header{
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header:hover + .header_nav_container {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue