Thank you for the quick reply.
Not knowing how to code, I did some research based on your suggestion and came up with the following replacements for the fourth and fifth lines in showSlides. However, the prev and next buttons still show up.
if (slideIndex > slides.length) {
document.getElementByClassName("next").style.display = "block";
}
if (slideIndex < 1) {
document.getElementByClassName("prev").style.display = "none"
}
the CSS is where the priv and next classes are defined:
/* Next & previous buttons */
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
padding: 16px;
margin-top: -22px;
color: white;
font-weight: bold;
font-size: 18px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
}
/* Position the "next button" to the right */
.next {
right: 0;
border-radius: 3px 0 0 3px;
}
/* On hover, add a black background color with a little bit see-through */
.prev:hover, .next:hover {
background-color: rgba(0,0,0,0.8);
}