Thursday, April 28, 2005

Website tip #5-07 (scrolling text in status bar)

Internet browsers have a small area at the bottom of the browser window where status information is displayed. There is a small section that can display a scrolling text message across the status bar.

This can be a handy feature to make sure that your website visitors see an announcement. To see an example, go to
http://www.webcubic.info. Notice the scrolling text message at the bottom of the browser window.

To implement this, copy the text below and paste it into your "profile" section of your website. The "text below" is the line that has "Script" through the line that has "/Script".

[!-- Scrolling text message --]
[Script LANGUAGE="JavaScript"]

var Count = 0;

var Text = "Place your text here";
var Speed = 90;
var timerID
= null;var TimerRunning = false;
var i = 0;

while (i ++ [140)
Text = " " + Text;
function Scroll(){
window.status = Text.substring(Count++, Text.length);
if (Count == Text.length)
Count = 0;
timerID = setTimeout("Scroll()", Speed);
TimerRunning = true;
}
function Start(){
Stop();
Scroll();
}
function Stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}
Start();
[/Script]


You must change the left and right brackets with the corresponding "less than" and "greater than" symbols.

NOTE: At the very beginning of your "profile" section, you must put in a special command.

[html]

At the very end of your "profile" section, you must put in a similar special command.

[/html]

Again, you must change the left and right brackets with the corresponding "less than" and "greater than" symbols.