Fix: Stop carousel on navigatrion button click
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
553b24197e
commit
4c7c2de0e8
|
@ -68,7 +68,6 @@
|
|||
<script>
|
||||
// Spin carousel after fife seconds
|
||||
const carousel = document.querySelector('#carousel-nav');
|
||||
const carouselItems = carousel.querySelectorAll('.nav-item');
|
||||
const carouselLocators = document.querySelectorAll('.carousel-locator');
|
||||
let carouselIndex = 1;
|
||||
|
||||
|
@ -86,7 +85,14 @@
|
|||
}, 5000);
|
||||
|
||||
// stop carousel when clicked manually on any item
|
||||
for(const item of carouselItems) {
|
||||
for(const item of carousel.querySelectorAll('.nav-item')) {
|
||||
item.addEventListener('click', () => {
|
||||
clearInterval(carouselInterval);
|
||||
});
|
||||
}
|
||||
|
||||
// stop carousel when clicked on any item-next or item-prev
|
||||
for(const item of document.querySelectorAll('.item-next, .item-prev')) {
|
||||
item.addEventListener('click', () => {
|
||||
clearInterval(carouselInterval);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue