Nouveau marché à Carouge tout les mercredis dès le 2 Avril 2025!

document.addEventListener('DOMContentLoaded', function() { const banner = document.getElementById('akg-banner'); const header = document.querySelector('.elementor-location-header'); const headerContent = document.querySelector('.elementor-element-4afb247'); const maxPushHeight = 70; // Max push height in pixels let pushHeight = Math.min(banner.offsetHeight, maxPushHeight); // Use banner height but cap at 25px let hasScrolled = false; // Aggressive reset on load banner.classList.remove('visible', 'static'); header.classList.remove('has-banner', 'pushed'); headerContent.style.marginTop = '0'; banner.style.display = 'block'; // Ensure banner is visible initially // Add banner presence class after reset setTimeout(() => { header.classList.add('has-banner'); }, 10); // Slight delay to ensure reset takes effect // Slide in banner after 0.68s setTimeout(function() { banner.classList.add('visible'); // After slide-in animation (600ms matches CSS) setTimeout(function() { banner.classList.remove('visible'); banner.classList.add('static'); header.classList.add('pushed'); headerContent.style.marginTop = `${pushHeight}px`; // Dynamic but capped push }, 600); }, 680); // Handle scroll behavior - banner hides once and stays hidden window.addEventListener('scroll', function() { if (window.scrollY > 70 && !hasScrolled) { banner.style.display = 'none'; header.classList.remove('pushed'); headerContent.style.marginTop = '0'; hasScrolled = true; } }); }); ->

Bienvenue à la Ferme du Sonneur

Maraîchage biologique et diversifié