Added preventDefault() behavior on Carousel prev/next button click event handlers.

This commit is contained in:
David Ball 2024-07-14 22:46:25 -04:00
parent 59d101676e
commit 5f6691e059

View File

@ -59,9 +59,11 @@ class ImageCarousel extends HTMLElement {
const nextButton = $(this).find('.carousel-btn-next');
prevButton.click((evt: Event) => {
this.plusSlides(-1);
evt.preventDefault();
});
nextButton.click((evt: Event) => {
this.plusSlides(1);
evt.preventDefault();
});
this.showSlide(this.slideIndex);
}
@ -149,6 +151,7 @@ image-carousel {
align-items: center;
justify-content: center;
font-size: 2rem;
outline: none !important;
}
/* .carousel-btn-prev > a span, .carousel-btn-next > a span {
position: relative;