I am trying to switch my div class using a timer, and I'm always switching between 2 classes.
Here is the beginning of the div code
<div id="this" class="photobanner">
You can check the JQuery function and timer I made below
function autoAddClass(){
if( $( '#this' ).hasClass( 'first' ))
$('.first').addClass('last');
if{$('#this').hasClass('last'))
$('.last').addClass('first');
}
setTimeout(autoAddClass, 1000);
This is not working