Ir al contenido

OTTODISANPIETRO

Consigue nuestra app ✨

Descargar

Cesta

La cesta está vacía

Selecciona el tipo de envoltorio

DROP 01

ALAÏA

REGÍSTRATE O INICIA SESIÓN PARA ACCEDER A LA COLECCIÓN.

document.addEventListener('DOMContentLoaded', function () { const dropdown = document.querySelector('.header__dropdown-menu'); const primaryNav = document.querySelector('.header__primary-nav'); function showMenu() { dropdown.style.display = 'block'; dropdown.style.opacity = '1'; } function hideMenu() { dropdown.style.opacity = '0'; setTimeout(() => { dropdown.style.display = 'none'; }, 300); } primaryNav.addEventListener('mouseenter', showMenu); primaryNav.addEventListener('mouseleave', hideMenu); primaryNav.addEventListener('click', function (event) { event.stopPropagation(); if (dropdown.style.display === 'block') { hideMenu(); } else { showMenu(); } }); document.addEventListener('click', function (event) { if (!primaryNav.contains(event.target) && !dropdown.contains(event.target)) { hideMenu(); } }); });