I'm a jQuery novice to say the least so please bear with me here.
function swapImagesMaps(){
var $active = $('#maps .active');
var $next = ($('#maps .active').next().length > 0) ? $('#maps .active').next() : $('#maps img:first');
$active
.fadeOut(function(){
$active
.removeClass('active');
$next
.fadeIn().addClass('active');
});
}
setInterval('swapImagesMaps()', 2000);
This is cool, but I have 4 different div containers with images in them, and I want them to fade every 2 seconds.
So div1 will change and then 2 seconds later div2 will change, and so on. Once it loops through all 4 div containers, it will go back to div1 and change that one again and just keep cycling through.
Hopefully this makes sense and I appreciate any help or suggestions!