TickerTape Message in a Form

[Total: 0    Average: 0/5]

This example sets up a form text box and inserts text into it one character at a time.

Body Code:

<form name=tickform>
<input type=text name=tickfield size="60" value="<default>">
</form>
<SCRIPT LANGUAGE="JavaScript"> 
<!-- Begin //
var max=0; 
function textlist() { 
max=textlist.arguments.length; 
for (i=0; i<max; i++) 
this[i]=textlist.arguments[i]; 
} 
tl = new textlist( 
"This is the first message", 
"This is the next message", 
"This is the Last Message..."
); 

var x = 0;
var pos = 0; 
var l = tl[0].length; 
function textticker() { 
document.tickform.tickfield.value = tl[x].substring(0, pos) + "_"; 
if(pos++ == l) { 
pos = 0; 
setTimeout("textticker()", 2000); 
if(++x == max) x = 0; 
l = tl[x].length; 
} else 
setTimeout("textticker()", 50); 
} 
textticker();
//  End --> 
</script> 

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *