I would add a common class to all divs and wrap them in a div.
Try:
var len = $("#container").find(".section").length;
setInterval(function(){
var current = $(".section:visible");
var active = $(current).index();
var next;
if(active == len-1){
next = 0;
}
else{
next = active+1;
}
$(current).hide();
$("#container .section:eq("+next+")").fadeIn();
},1000);
4
solved I need to fadein fadeout 3 divs [closed]