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 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    scrolling message in status bar

    Hi,

    I am trying to find a code that will allow me to put random messages (one at a time, and NOT ongoing)...I want it to scroll once, and then stop in the lower left corner of the status bar. If my site visitors "refresh" the page, it should generate a different message.

    I have been able to find ones that put all the messages together one after another, but I just want one message at a time. That way, they can get a different message each time they visit my site.

    So, I'm looking for a script that allows for multiple messages, that would be put in the status bar in a random order, but will only give one message at a time, and will only scroll once and stop. Then the next time they visit (or if they refresh the page), they will get a different message.

    Can you please help me? Any help is greatly appreciated

    Steve




    Here's the code I'm putting between the HEAD tags:

    <script type="text/javascript">
    <!--
    /*
    Script for scrolling the statusbar text
    */

    /*** Configurable Section ***/
    // Speed of scrolling
    var SS_Delay = 80;
    // Position to start scrolling
    var SS_SPos = 100;
    // Whether or not to display messages in random order
    var SS_Random = false;
    // Messages to scroll
    var SS_ArMsg = new Array(
    'This is line 1',
    'This is line 2',
    'This is line 3',
    'This is line 4'
    );
    /*** No need to edit below this ***/
    var SS_Timer = null;
    var SS_Pos = -1;
    var SS_Msg = "";
    var SS_MsgId = -1;
    var SS_MsgLen = SS_ArMsg.length;

    // Start Scrolling
    function SS_Start(){
    if(SS_Timer)clearTimeout(SS_Timer);
    SS_Scroll();
    }
    // Function for performing scroll
    function SS_Scroll(){
    if(SS_Pos <= SS_Msg.length){
    self.status = SS_Msg.substring(SS_Pos, SS_Pos + SS_SPos);
    }else{
    SS_NextMsg();
    SS_Pos = -1;
    }
    SS_Pos++;
    SS_Timer = self.setTimeout("SS_Scroll()", SS_Delay);
    }
    // Get the Next Message for scrolling
    function SS_NextMsg(){
    if(SS_Random){
    SS_MsgId = parseInt(Math.random() * SS_MsgLen);
    }else{
    SS_MsgId = (++SS_MsgId >= SS_MsgLen) ? 0 : SS_MsgId;
    }
    SS_Msg = SS_ArMsg[SS_MsgId];
    // Prepend the string with space to match the
    // specified starting position
    for(var i = 0; i < SS_SPos; i++){
    SS_Msg = " " + SS_Msg;
    }
    }

    // Start Scrolling
    SS_Start();
    //-->
    </script>

  • #2
    New Coder
    Join Date
    Feb 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    please help!

    Anybody? Please help me with this...thanks :-)

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,603
    Thanks
    0
    Thanked 645 Times in 635 Posts
    Modern browsers don't allow Javascript to update the status bar and so the only effect that such scripts have these days is to slow down your page loading in the browser.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #4
    New Coder
    Join Date
    Feb 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It works fine in my IE7 browser, so I disagree. I just need it to stop scrolling. You apparently didn't read my complete thread. Read it again and see if you can assist

  • #5
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by stevenmiller74 View Post
    So, I'm looking for a script that allows for multiple messages, that would be put in the status bar in a random order, but will only give one message at a time, and will only scroll once and stop. Then the next time they visit (or if they refresh the page), they will get a different message.
    I think this should fit the bill: Link


  •  

    Posting Permissions

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