Well, I'm having some problems with a carousel created by myself, more specifically in the transition order of the items.
var carouselBannerHolder = document.getElementById("banners-slider");
var itemsCarousel = document.querySelectorAll(".banners-slider figure");
var count = 0;
carouselBannerHolder.style.width = (parseInt(itemsCarousel.length)) + "00%";
function ordemComumSlide(){
setInterval(function(){
if(count < itemsCarousel.length){
carouselBannerHolder.style.left = ("-" + count + "00%");
count++;
}else{
return count = 0;
}
},2500);
};
ordemComumSlide();
On the first slide, it takes twice as long when the page starts, then it works normally, how can I fix it? is there anything in the code that I can improve on?