I am trying to get this while loop to loop through a bunch of numbered divs with class numbers 1 through 4 one after another. Somewhere it is going awry. Thanks for your help!
var div = 1;
while (div < 5){
$("." + div).fadeIn().delay(4000).fadeOut(function(){
div++;
});
}
You can to delay the fadeIn() incrementally:
HTML:
JavaScript:
Demo: http://jsfiddle.net/bN28x/2/