Merge branch 'master' of code.areya.de:Areya/basic-business-template

master
Benjamin Völkl 2024-01-10 22:26:30 +01:00
commit 9e336e5a24
1 changed files with 7 additions and 4 deletions

View File

@ -232,7 +232,9 @@
if (entry.isIntersecting) {
// Remove the element to remove
elementToRemove.classList.remove('show');
setTimeout(() => elementToRemove.style.display = 'none', 1200);
setTimeout(() => {
if(!elementToRemove.classList.includes('show')) elementToRemove.style.display = 'none';
}, 800);
} else {
const fixedElementRect = elementToRemove.getBoundingClientRect();
const referenceElementRect = targetElement.getBoundingClientRect();
@ -240,12 +242,13 @@
if (fixedElementRect.bottom < referenceElementRect.top) {
// Show the element to remove
elementToRemove.style.display = 'block';
setTimeout(() => elementToRemove.classList.add('show'), 1200);
elementToRemove.classList.add('show');
} else {
// Hide the element to remove
//elementToRemove.style.display = 'none';
elementToRemove.classList.remove('show');
setTimeout(() => elementToRemove.style.display = 'none', 1200);
setTimeout(() => {
if(!elementToRemove.classList.includes('show')) elementToRemove.style.display = 'none';
}, 800);
}
}
// Stop observing once it's removed (optional)