Fix some errors with ViewTransitions
This commit is contained in:
@@ -118,10 +118,11 @@ import { UI } from 'astrowind:config';
|
|||||||
|
|
||||||
function applyHeaderStylesOnScroll() {
|
function applyHeaderStylesOnScroll() {
|
||||||
const header = document.querySelector('#header[data-aw-sticky-header]');
|
const header = document.querySelector('#header[data-aw-sticky-header]');
|
||||||
|
if (!header) return;
|
||||||
if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) {
|
if (lastKnownScrollPosition > 60 && !header.classList.contains('scroll')) {
|
||||||
document.getElementById('header').classList.add('scroll');
|
header.classList.add('scroll');
|
||||||
} else if (lastKnownScrollPosition <= 60 && header.classList.contains('scroll')) {
|
} else if (lastKnownScrollPosition <= 60 && header.classList.contains('scroll')) {
|
||||||
document.getElementById('header').classList.remove('scroll');
|
header.classList.remove('scroll');
|
||||||
}
|
}
|
||||||
ticking = false;
|
ticking = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user