ImageSlider

This commit is contained in:
2024-10-24 14:04:46 +02:00
parent 0526b47ea4
commit 6e020509db
34 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,16 @@
const files = [];
let current = 0;
for (let i = 1; i <= 30; i++) {
files.push(`(${i}).jpg`);
}
function changeSlide(val){
current += val;
if (current > files.length - 1) {
current = 0;
}
if (current < 0) {
current = files.length - 1;
}
document.getElementById("slided").src = `./IMG/${files[current]}`;
}