When the HTML loads for the first time, the div slideshow remains hidden until a button is clicked. Any suggestions on how to display the first div without requiring a button click?
var slideIndex = 1;
showDivs(slideIndex);
function plusDivs(n) {
showDivs(slideIndex += n);
}
function showDivs(n) {
var i;
var x = document.getElementsByClassName("mySlides");
if (n > x.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = x.length;
}
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
x[slideIndex - 1].style.display = "block";
}
<div class="row">
<div class="col-xs-1">
<button style="margin-top:70px" onclick="plusDivs(-1)">❮</button>
</div>
<div class="col-xs-10">
<div class="mySlides" v-for="review in reviews">
<div class="row">
<div class="col">
<div class="card">
<div class="card-body" style="padding:0px">
<h5 class="card-title text-warning">{{review.name}}</h5>
<p style="text-align:justify">{{review.review}}</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-1">
<button style="margin-top:80px" onclick="plusDivs(1)">❯</button>
</div>
</div>