Here is my HTML code, where I am looking to dynamically swap the classes between two li
elements every 2 seconds using jQuery.
<li class="">
<a href="#">
<img src="client_logo01.png">
</a>
</li>
<li class="active">
<a href="#">
<img src="client_logo02.png">
</a>
</li>
This is how I'm attempting to accomplish it:
$('ul li a').click(function() {
$('ul li.current').removeClass('active');
$(this).closest('li').addClass('active');
});
However, this current method only works on click events and I need it to happen automatically. Any suggestions?