...

View Full Version : scrolling text with color



truviet911
07-08-2007, 09:11 AM
hey guys is it possible to have scrolling text on status bar with a specify color? for example i have this code on my page the default text is black. but how do i change the text color? me don't know about javascript hehe

<Script LANGUAGE="JavaScript">
var Count = 3;
var Text = " ** Type your personalized message here! And you are set.";
var Speed = 60;
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>

rwedge
07-08-2007, 08:38 PM
Most browsers do not give you access to the status bar and it could be turned off by the user.

Should these lines be in there?
var i = 0;
while (i ++ < 140)
Text = " " + Text;


Unless you are using ** as a leader, you should reset Count to 3 in the Scroll function.

Instead of using 'Start();' to run the script you should use
window.onload=Start; or <body onload="Start()">

truviet911
07-09-2007, 06:17 AM
Most browsers do not give you access to the status bar and it could be turned off by the user.

Should these lines be in there?
var i = 0;
while (i ++ < 140)
Text = " " + Text;


it still works if you take it out .
Unless you are using ** as a leader, you should reset Count to 3 in the Scroll function.

Instead of using 'Start();' to run the script you should use
window.onload=Start; or <body onload="Start()">

for this one . i don't understand what you trying to say. srry im bad at english.

Philip M
07-09-2007, 07:19 AM
The answer to your question is no, you cannot alter the colour of the text in the status bar.

For the rest,

var i = 0;
while (i ++ < 140)
Text = " " + Text;

adds 140 spaces before the start of the message so as to approximately centre it in the screen. You may want to adjust 140 depending on the actual length of your own message.

"Instead of using 'Start();' to run the script you should use
window.onload=Start; or <body onload="Start()">" Both of these are simply alternative ways of calling the script.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum