I'm fairly new to JavaScript and JQuery. I've written a series of ends to a paragraph that I'm attempting to rotate with one another using a for loop. Although I am seeing the number of fades, the text isn't changing on my site.
Here's the code:
var paragraphs = ["foo", "bar", "foobar"];
var rotateText = function(){
for(var i = 0; i < paragraphs.length; i++){
$("#id").text(paragraphs[i]).fadeIn(2000).delay(2000).fadeOut(2000);
}
};
rotateText();
fadeIn()(and its friends) isn't synchronous.