SO question
https://stackoverflow.com/q/64690396/1238244
by Luke Harby
HTML
<div class="carouselbox">
<div class="slideshow-container">
<div class="slips sfade" style="display: none;">
<div class="numbertext">1 / 3</div>
<img src="https://via.placeholder.com/350x110" style="width:100%">
<div class="captext">Caption Text</div>
</div>
<div class="slips sfade" style="display: none;">
<div class="numbertext">2 / 3</div>
<img src="https://i.imgur.com/luWoKhZ.png" style="width:100%">
<div class="captext">Caption Two</div>
</div>
<div class="slips sfade" style="display: none;">
<div class="numbertext">3 / 3</div>
<img src="https://via.placeholder.com/500x110" style="width:100%">
<div class="captext">Caption Three</div>
</div>
</div>
<br>
<div style="text-align:center">
<span class="bottomdots"></span>
<span class="bottomdots"></span>
<span class="bottomdots"></span>
</div></div>
CSS
*, *:before, *:after {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
text-rendering: optimizeLegibility;
}
img {
display: block;
max-width: 100%;
height: auto !important;
margin: 0 auto;
}
body,html {
padding: 0;
margin: 0;
}
body {
background: #bba7ac;
color: #262626;
font-family: Baskerville, 'Times New Roman', Times, serif;
font-weight: 400;
}
a, a:visited {
color: #9248a8;
text-decoration: none;
}
a:hover, a:active {
color: #9a618e;
}
img {
margin: 5px auto;
display: block;
}
h1, h2, h3 {
font-weight: 400;
letter-spacing: 1px;
}
h3 {
font-size: 150%;
}
article, aside, footer, header, nav, section {
display: block;
}
header, footer {
text-align: center;
}
.c-fluid{
display: block;
position: relative;
margin: 0 auto;
max-width: 100%;
height: auto;
padding: 10px;
}
blockquote {
border-left:; 2px solid #9248a8;
padding-left: 12px;
}
/* Header + Title */
header {
background: #bba7ac;
background-size: cover;
background-position: center;
}
#logo {
font-family: 'Typewriter FS', serif;
font-size: 50px;
font-weight: 700;
letter-spacing: 2px;
margin: 50px auto 20px;
padding: 10px;
text-transform: uppercase;
padding-bottom: 40px;
}
#logo a, #logo a:visited {
color: #262626;
text-decoration: none;
}
#logo a:hover, #logo a:active {
color: #9a618e;
}
.avatar {
border-radius: 100%;
}
/* Content Container */
.wrapper:before,
.wrapper:after {
display: table;
content: '';
}
.wrapper:after {
clear: both;
}
.cc {
margin: 0 auto;
padding: 0;
}
.cc,
.sc {
overflow: hidden;
}
/* Container */
.c {
background: #FEFEFE;
}
/* Sidebar */
.s {
background: #FEFEFE;
text-align: center;
...
JavaScript
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("slips");
var dots = document.getElementsByClassName("bottomdots");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {
slideIndex = 1
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" activedot", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " activedot";
setTimeout(showSlides, 2000); // Change image every 2 seconds
}