Trying to make a text ... loading animation
here\'s where I stand: http://jsfiddle.net/aGfct/
I can get the ... to be added at 500 ms intervals, but then I w
i = 0;
setInterval(function() {
i = ++i % 4;
$("#loading").html("loading"+Array(i+1).join("."));
}, 500);
If you wish to change the string after 5 says, that's after 10 iterations. This can be accomplished like this.
i = 0;
text = "loading";
setInterval(function() {
$("#loading").html(text+Array((++i % 4)+1).join("."));
if (i===10) text = "start";
}, 500);