I have 4 pictures which I want to change every 3 seconds, but fade it out/in.
I change the pictures successfully but when I add the fadeOut I get the error action.js:14 Uncaught TypeError: $(...).fadeOut is not a function
$(document).ready(function(){
count = 1;
setInterval(function () {
count++;
$('#mainimg').fadeOut(200, function() { //THIS CAUSES THE ERROR
$('#mainimg').attr('src','img/phone' + count + '.png');
});
if(count == 4){
count = 1;
}
}, 3000);
})
This is the entire JS code I have, there is nothing more.