0
Well, I’m having some problems with a self-made carousel, 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 works normally, how can I fix ? there’s something in the code too, in which I can improve ?
but the problem is not in html, it’s just the same js, because, I wanted to know why it takes twice as long to load the first slide backwards
– Murilo Melo
I don’t think HTML would help much, because it’s a div with figures inside
– Murilo Melo
I’ll edit with the functions add-ons, I forgot that
– Murilo Melo