Forum Moderators: open
I'm trying to animate some text. Basically while a page is loading, I have a floating layer asking the user to be patient while their task is being completed.
I'd like to have something like:
Working... (have the dots flashing on in order)
Working.[wait].[wait].[wait]. {disappear and repeat}
How can I tackle this?
Thanks!
var tl=new Array(
"The requested document is totally not here! ",
"Nothing but 404 here. ",
"Even tried multi times. ",
"Nothing helped. ");// etc.
function type_text()
{
contents='';
row=Math.max(0,index-9); // This prevents scrolling issues by cutting off the upper text.
while(row<index)
{
contents += tl[row++];
contents = contents.concat ( '\n' );
}
document.getElementById('depressed').bemoan.value = contents + tl[index].substring(0,text_pos) + "_";
if(text_pos++==str_length)
{
text_pos=0;
index++;
if(index!=tl.length)
{
str_length=tl[index].length;
setTimeout("type_text()",1000);
}
else
window.setTimeout("window.location.replace('index.htm')", 5000);} else
setTimeout("type_text()",speed);
}
type_text();
in which "depressed" is a textarea.