Status bar scroller

Discussion in 'Javascript' started by mistral, Mar 20, 2007.

  1. mistral

    mistral Guest

    Simple status bar scroller:

    </head>
    <SCRIPT LANGUAGE="JavaScript">

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    var Message="Welcome To Draac.Com";
    var place=1;
    function scrollIn() {
    window.status=Message.substring(0, place);
    if (place >= Message.length) {
    place=1;
    window.setTimeout("scrollOut()",300);
    } else {
    place++;
    window.setTimeout("scrollIn()",50);
    }
    }
    function scrollOut() {
    window.status=Message.substring(place, Message.length);
    if (place >= Message.length) {
    place=1;
    window.setTimeout("scrollIn()", 100);
    } else {
    place++;
    window.setTimeout("scrollOut()", 50);
    }
    }
    // End -->
    </SCRIPT>
    </head>


    <BODY onLoad="scrollIn()">

    Want place script somewhere inside body, not in head section, and take
    away onLoad="scrollIn()"> function from <body>. What need be
    corrected?

    thanks
     
    mistral, Mar 20, 2007
    #1
    1. Advertising

  2. mistral

    Tom Cole Guest

    On Mar 20, 12:30 pm, "mistral" <> wrote:
    > Simple status bar scroller:
    >
    > </head>
    > <SCRIPT LANGUAGE="JavaScript">
    >
    > <!-- This script and many more are available free online at -->
    > <!-- The JavaScript Source!!http://javascript.internet.com-->
    >
    > <!-- Begin
    > var Message="Welcome To Draac.Com";
    > var place=1;
    > function scrollIn() {
    > window.status=Message.substring(0, place);
    > if (place >= Message.length) {
    > place=1;
    > window.setTimeout("scrollOut()",300);} else {
    >
    > place++;
    > window.setTimeout("scrollIn()",50);}
    > }
    >
    > function scrollOut() {
    > window.status=Message.substring(place, Message.length);
    > if (place >= Message.length) {
    > place=1;
    > window.setTimeout("scrollIn()", 100);} else {
    >
    > place++;
    > window.setTimeout("scrollOut()", 50);}
    > }
    >
    > // End -->
    > </SCRIPT>
    > </head>
    >
    > <BODY onLoad="scrollIn()">
    >
    > Want place script somewhere inside body, not in head section, and take
    > away onLoad="scrollIn()"> function from <body>. What need be
    > corrected?
    >
    > thanks


    I assume you are using a templated site and don't have access to the
    <head> section directly?

    You can try placing the script block at the very end of your page (or
    at least the section you have control over) and add the following line
    to the very end (immediately before the closing </script> tag:

    scrollIn();

    HTH.
     
    Tom Cole, Mar 20, 2007
    #2
    1. Advertising

  3. mistral

    mistral Guest

    On 20 mar, 19:33, "Tom Cole" <> wrote:
    > On Mar 20, 12:30 pm, "mistral" <> wrote:
    >
    >
    >
    >
    >
    > > Simple status bar scroller:

    >
    > > </head>
    > > <SCRIPT LANGUAGE="JavaScript">

    >
    > > <!-- This script and many more are available free online at -->
    > > <!-- The JavaScript Source!!http://javascript.internet.com-->

    >
    > > <!-- Begin
    > > var Message="Welcome To Draac.Com";
    > > var place=1;
    > > function scrollIn() {
    > > window.status=Message.substring(0, place);
    > > if (place >= Message.length) {
    > > place=1;
    > > window.setTimeout("scrollOut()",300);} else {

    >
    > > place++;
    > > window.setTimeout("scrollIn()",50);}
    > > }

    >
    > > function scrollOut() {
    > > window.status=Message.substring(place, Message.length);
    > > if (place >= Message.length) {
    > > place=1;
    > > window.setTimeout("scrollIn()", 100);} else {

    >
    > > place++;
    > > window.setTimeout("scrollOut()", 50);}
    > > }

    >
    > > // End -->
    > > </SCRIPT>
    > > </head>

    >
    > > <BODY onLoad="scrollIn()">

    >
    > > Want place script somewhere inside body, not in head section, and take
    > > away onLoad="scrollIn()"> function from <body>. What need be
    > > corrected?

    >
    > > thanks

    >
    > I assume you are using a templated site and don't have access to the
    > <head> section directly?
    >
    > You can try placing the script block at the very end of your page (or
    > at least the section you have control over) and add the following line
    > to the very end (immediately before the closing </script> tag:
    >
    > scrollIn();
    >
    > HTH.


    -------------

    Yes, exactly. This is a templated site where I don't have access to
    the <head> section directly, only to one section inside body.
    It works, in my offline test page, at least. No needs for '}' braces
    after scrollIn(); ?

    Thanks.
     
    mistral, Mar 20, 2007
    #3
  4. mistral

    mistral Guest

    On 21 mar, 01:55, Randy Webb <> wrote:
    > mistral said the following on 3/20/2007 1:30 PM:


    > > Simple status bar scroller:


    > <snip>


    > > <BODY onLoad="scrollIn()">


    > > Want place script somewhere inside body, not in head section, and take
    > > away onLoad="scrollIn()"> function from <body>. What need be
    > > corrected?


    <script type="text/javascript">
    window.onload = scrollIn;
    </script>

    > Aside from that, what need be corrected is about 99% of what you posted.


    > > thanks


    > Sure.


    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
    > Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/


    ---------------
    window.onload = scrollIn;

    This line also need be placed at the very end of script?(immediately
    before the closing </script> tag)


    thanks.
     
    mistral, Mar 21, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,602
  2. John Hann
    Replies:
    0
    Views:
    6,167
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    71,246
  4. Matt
    Replies:
    9
    Views:
    637
    kaeli
    Aug 23, 2004
  5. mistral

    Status bar scroller

    mistral, Mar 20, 2007, in forum: Javascript
    Replies:
    0
    Views:
    96
    mistral
    Mar 20, 2007
Loading...

Share This Page