Hello,
I'm messing around with HTML / CSS, I've been making a slide and I've had a doubt, probably from JavaScript.
I made a mini slide of featured products, and on the side of this slide, has the text referring to the product. Is there any way to handle the slide, so that when the person clicks to change the slide image, the text changes along with the image?
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="large-12 columns">
<div class="w3-content" style="max-width:100%;position:relative; padding: 5px;">
<div class="container">
<div class="row">
<div class="large-7 columns" style="margin-top: 50px;">
<img class="mySlides" src="http://niderarep.com.br/wp-content/uploads/2013/04/logo-quero-grande.png"style="width:100%">
<img class="mySlides" src="https://img.meutimao.com.br/_upload/forumtopico/2016/01/28/eduardo-jorge-quero.jpg"style="width:100%">
<img class="mySlides" src="http://m.memegen.com/0ekn13.jpg"style="width:100%">
<img class="mySlides" src="http://www.rstche.com.br/imagens/quero-quero.jpg"style="width:100%">
<a class="w3-btn-floating" style="position:absolute;top:50%;left:0" onclick="plusDivs(-1)">❮</a>
<a class="w3-btn-floating" style="position:absolute;top:50%;right:0px" onclick="plusDivs(1)">❯</a>
</div>
<div class="large-5 columns" style="margin-top: 50px;">
<h3>Título produto em destaque</h3>
<p style="line-height: 2.0;">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<a href="http://www.wgmodelo.com.br/index.html">
<button style="float:right; background: #000;">Saiba mais</button>
</a>
</div>
</div>
</div>
</div>
</div>
Thank you in advance.