fixedunderrefactor
This commit is contained in:
@@ -11,6 +11,12 @@
|
||||
visibility: hidden !important;
|
||||
transition: none !important; /* No transition on first load */
|
||||
}
|
||||
|
||||
/* Ensure header is transparent sitewide when not sticky */
|
||||
.header-hide-until-scroll:not(.sticky-container-active) {
|
||||
background-color: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
</style>
|
||||
<link crossorigin data-rocket-preconnect href="https://fonts.googleapis.com" rel="preconnect">
|
||||
<link crossorigin data-rocket-preconnect href="https://8ded8880.delivery.rocketcdn.me" rel="preconnect">
|
||||
|
||||
@@ -591,4 +591,24 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</header>
|
||||
<script>
|
||||
(function($) {
|
||||
$(function() {
|
||||
// Header scroll visibility logic - Globalized
|
||||
const $header = $('.header-hide-until-scroll');
|
||||
|
||||
// Show header once the page has started to load to avoid flicker
|
||||
// but maintain the hide-until-scroll behavior if needed
|
||||
$header.addClass('header-visible-scrolled');
|
||||
|
||||
$(window).on('scroll', function() {
|
||||
const scrollTop = $(this).scrollTop();
|
||||
// Maintain visibility after scroll
|
||||
if (scrollTop >= 0) {
|
||||
$header.addClass('header-visible-scrolled');
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
Reference in New Issue
Block a user