Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2004
    Location
    California
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scrolling text with color

    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>

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    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?
    Code:
    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()">

  • #3
    New Coder
    Join Date
    Sep 2004
    Location
    California
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by rwedge View Post
    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?
    Code:
    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.

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,985
    Thanks
    203
    Thanked 2,536 Times in 2,514 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •