I don't understand why when the function has to show a counter it works and if I ask her to translate an element she translate it only once.
This is the code, I tried a lot but I can't find a solution:
var i; // set your counter to 1
var numberOfImages = document.getElementsByClassName("imgs").length;
var imgWidth = window.innerWidth;
console.log(numberOfImages);
var startIt = setInterval(function() {
document.getElementById("carouselTrain").style.transform = "translateX(" + -imgWidth + "px)";
document.getElementById("carouselTrain").style.transitionDuration = "0.5s";
document.getElementById("carouselTrain").style.transform = "translateX(" + -imgWidth + "px)";
document.getElementById("carouselTrain").style.transitionDuration = "0.5s";
}, 1000);