Εμφάνιση του μοναδικού αποτελέσματος

document.addEventListener("DOMContentLoaded", function () { if (!document.body.classList.contains("single-product")) return; let showSticky = false; let hideTimeout; let lastScrollTop = 0; window.addEventListener("scroll", function () { const scrollTop = window.pageYOffset || document.documentElement.scrollTop; if (scrollTop > lastScrollTop && !showSticky) { showSticky = true; setTimeout(() => { document.body.classList.add("show-sticky"); }, 3000); } if (scrollTop < lastScrollTop) { clearTimeout(hideTimeout); hideTimeout = setTimeout(() => { document.body.classList.remove("show-sticky"); showSticky = false; }, 200); } lastScrollTop = scrollTop <= 0 ? 0 : scrollTop; }); });