document.addEventListener('DOMContentLoaded', function() { const mainDiv = document.getElementById('homeMenuBackground'); const links = [ { id: 'logosHM', image: 'url(/wp-content/uploads/2025/01/Logos-Background-Tiny.png)' }, { id: 'printHM', image: 'url(/wp-content/uploads/2025/01/PrintDigital-Background-Tiny.png)' }, { id: 'webHM', image: 'url(/wp-content/uploads/2025/01/Web-Background-Tiny.png)' }, { id: 'socialHM', image: 'url(/wp-content/uploads/2025/01/Logo-Background-Tiny.png)' } ]; links.forEach(link => { const element = document.getElementById(link.id); element.addEventListener('mouseover', function() { mainDiv.style.backgroundImage = link.image; mainDiv.style.backgroundSize = 'cover'; mainDiv.style.backgroundPosition = 'center center'; mainDiv.style.backgroundRepeat = 'no-repeat'; }); element.addEventListener('mouseout', function() { mainDiv.style.backgroundImage = ''; // Reset the background image when not hovering }); }); });
EXTRAS