document.addEventListener("DOMContentLoaded", function () { let bgSlideShows = document.querySelectorAll('#bgslideshow01 > .slideshow'); let myIndex = 1; function slideShow() { bgSlideShows.forEach(slide => { slide.style.display = 'none'; }); bgSlideShows[myIndex - 1].style.display = 'block'; if (myIndex === bgSlideShows.length) { myIndex = 1; } myIndex++; setTimeout(slideShow, 7000); } slideShow(); });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter