From 8ea855820c50ab7b3b86408b519dd84bc29043dd Mon Sep 17 00:00:00 2001 From: bwbohl Date: Wed, 7 Dec 2022 00:51:35 +0100 Subject: [PATCH] Update head.html add event listeners to stop animation on mouseover and restart on mouseout --- _includes/head.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_includes/head.html b/_includes/head.html index abb41d1e..db969009 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -15,6 +15,12 @@ const indexCarousel = document.getElementById("index-carousel"); if (indexCarousel !== null) { animateCarousel(indexCarousel, 3000); + indexCarousel.addEventListener("mouseover", event => { + stopCarouselAnimation(indexCarousel); + }); + indexCarousel.addEventListener("mouseout", event => { + animateCarousel(indexCarousel, 3000); + }); } });