I have an array in my js file that loads images into html for a slideshow and for thumbnail navigation. The slideshow img src matches one of the thumbnail image src attributes every 4 seconds. This timing is based off of a setInterval.
I would like to continually check if the slideshow img src matches the thumbnail img src and then add a class of active to both. I have been able to add the class to the main slideshow and all of the thumbnails but I can't seem to be able to only add the class to ONLY the img elements with the matched src attributes
<div class="slideshow">
<!-- this img src attribute changes on a setInterval and matches one of the .imageHolder img src attributes at a time. I would like to addClass to img elements that have the same src and remove when they no longer match-->
<img class="slideshowimg" alt="" src="imgs/slide3_470hx690w.jpg" style="opacity: 1;">
</div>
<div class="description" style="opacity: 1;">
<h2>LOREM IPSUM BLAH BLAH BLAH</h2>
<p>lorem ipsum blah blah blah</p>
<a href="#" class="btn readmore">Read More</a>
</div>
<a href="#" class="btn prev">Previous</a>
<a href="#" class="btn next">Next</a>
<div class="window">
<div class="imageHolder" style="width: 690px;">
<img src="imgs/slide1_470hx690w.jpg">
<img src="imgs/slide2_470hx690w.jpg">
<img src="imgs/slide3_470hx690w.jpg">
<img src="imgs/slide4_470hx690w.jpg">
<img src="imgs/slide5_470hx690w.jpg">
</div>
</div>