14 lines
290 B
JavaScript
14 lines
290 B
JavaScript
{ffb9c285de3606bcd9b28ac01d137611d643971c true 290 script.js 0xc001eae230}
const imgs = document.getElementById("imgs");
|
|
const img = document.querySelectorAll("#imgs img");
|
|
|
|
let index = 0;
|
|
|
|
function run() {
|
|
index++;
|
|
|
|
if (index > img.length - 1) {
|
|
index = 0;
|
|
}
|
|
imgs.style.transform = `translateX(${-index * 500}px)`;
|
|
}
|
|
setInterval(run, 2000); |