diff --git a/playbeat/src/pages/home.astro b/playbeat/src/pages/home.astro index 9f14bcb..84614a0 100644 --- a/playbeat/src/pages/home.astro +++ b/playbeat/src/pages/home.astro @@ -41,18 +41,26 @@ const Canciones = [ if(leftArrow && rightArrow && carrusel){ for(let i = 0; i < carrusel.length; i++) { - let width = carrusel[i].offsetWidth; + leftArrow[i].addEventListener('click', () => { + let width = carrusel[i].offsetWidth; carrusel[i].scrollBy({ left: -width, behavior: 'smooth' }); }); rightArrow[i].addEventListener('click', () => { + let width = carrusel[i].offsetWidth; carrusel[i].scrollBy({ left: width, behavior: 'smooth' }); }); } } }) +