p5js/参考/p5-reference/js/slideshow.js

13 lines
308 B
JavaScript
Raw Normal View History

2022-12-07 12:42:16 +00:00
var slideIndex = 0;
carousel();
function carousel() {
var x = $("#slideshow").children();
for (var i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
slideIndex++;
if (slideIndex > x.length) {slideIndex = 1}
x[slideIndex-1].style.display = "block";
setTimeout(carousel, 4000);
}