From 5adeb560b067a1d1f8fb1eb1fd2a35b980f8a50f Mon Sep 17 00:00:00 2001 From: kailasnadh790 <53608019+kailasnadh790@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:35:21 -0500 Subject: [PATCH] Update carousel.js --- cigaradvisor/blocks/carousel/carousel.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cigaradvisor/blocks/carousel/carousel.js b/cigaradvisor/blocks/carousel/carousel.js index 349f1784..abfd9789 100644 --- a/cigaradvisor/blocks/carousel/carousel.js +++ b/cigaradvisor/blocks/carousel/carousel.js @@ -1,7 +1,7 @@ import { decorateIcons } from '../../scripts/aem.js'; import { isExternal } from '../../scripts/scripts.js'; -function setAutoScroll(moveSlides, slidesWrapper) { +function setAutoScroll(moveSlides, block) { let interval; let interacting = false; setTimeout(() => { @@ -10,7 +10,7 @@ function setAutoScroll(moveSlides, slidesWrapper) { moveSlides('next'); }, 6000); } - slidesWrapper.addEventListener('mouseleave', () => { + block.addEventListener('mouseleave', () => { interacting = false; interval = setInterval(() => { moveSlides('next'); @@ -19,7 +19,7 @@ function setAutoScroll(moveSlides, slidesWrapper) { }, 3000); // Stop auto-scroll on user interaction - slidesWrapper.addEventListener('mouseenter', () => { + block.addEventListener('mouseenter', () => { interacting = true; clearInterval(interval); });