I have this line of code, I use it to change the class from class1 until class4 to change the background of my site. I want to add a fadeIn each time the class changes, how can I do it? Thanks
Here is my code :
$(document).ready(function () {
var counter = 1;
int = setInterval(function(){
$("#transition").attr("class", "class" + counter);
if (counter === 4){
counter = 1;
} else {
counter++;
}
}, 3000);
});