Problema
Quero fazer com que ele adicione o atributo active
em suite-internal-item
e remova nos que tem, porém não está funcionando.
jQuery
$('.suite-internal-link').on('click',function(e){
e.preventDefault()
$('.suite-internal-item').each(function(e){
$('.suite-internal-item').removeClass('active')
$(this).addClass('active')
})
})
HTML
<ul class="suite-internal-items">
<li class="suite-internal-item active">
<img src="assets/images/aloha1.jpg" alt="">
</li>
<li class="suite-internal-item">
<img src="assets/images/aloha2.jpg" alt="">
</li>
<li class="suite-internal-item">
<img src="assets/images/aloha3.jpg" alt="">
</li>
</ul>
<div class="suite-internal-links">
<a href="" class="suite-internal-link">
<img src="assets/images/aloha1.jpg" alt="">
</a>
<a href="" class="suite-internal-link">
<img src="assets/images/aloha2.jpg" alt="">
</a>
<a href="" class="suite-internal-link">
<img src="assets/images/aloha3.jpg" alt="">
</a>
</div>