(231.htm) will include status bar messages that goes from left to right, and looks like a typewriter is typing the message. The main class example above goes from right to left & scrolls. In this exercise have the status bar display several (3 - 4) different messages with a pause (different than the typing speed) between each message.
NOTE: Don't use a for loop - this can get you into major trouble.
A template for possible use:
var frontPart, backPart;
var myMsg = "Hey, I know JavaScript - check out my kewl scroller! ... ";
var i = 0;
function scrollMsg() {
frontPart = myMsg.substring(i, myMsg.length);
backPart = myMsg.substring(0, i);
window.status = frontPart + backPart;
if (i < myMsg.length) i++;
else i = 0;
setTimeout("scrollMsg()", 50) ;
}
<Body onLoad="scrollMsg();">
This is an example of a typewriter scrolling message
...and here's a tip from the COIN 70b Yahoo! Group
Below is a possible template for 231 where the dots (...) need to be filled in.
...
var i = 0;
var Index = 0;
function typeMsg() {
status = Msg[Index].substring(0, i + 1);
if (i < Msg[Index].length) {
...
setTimeout("typeMsg()", 100);
}
else {
...
if (Index ...) ...++;
else ... = 0;
setTimeout("typeMsg()", 1000);
}
}
...