Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Status bar scroller

Reply
Thread Tools

Status bar scroller

 
 
mistral
Guest
Posts: n/a
 
      03-20-2007
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

 
Reply With Quote
 
 
 
 
Tom Cole
Guest
Posts: n/a
 
      03-20-2007
On Mar 20, 12:30 pm, "mistral" <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
 
mistral
Guest
Posts: n/a
 
      03-20-2007
On 20 mar, 19:33, "Tom Cole" <(E-Mail Removed)> wrote:
> On Mar 20, 12:30 pm, "mistral" <(E-Mail Removed)> 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.



 
Reply With Quote
 
mistral
Guest
Posts: n/a
 
      03-21-2007
On 21 mar, 01:55, Randy Webb <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Status bar scroller mistral Javascript 0 03-20-2007 05:28 PM
disable title bar, status bar, and address bar of a window Matt HTML 9 08-23-2004 07:49 PM
javascript to disable the title bar, status bar, and address bar of a window Matt Javascript 9 08-23-2004 01:23 PM
Re: disable title bar, status bar, and address bar of a browser window John Hann ASP .Net 0 08-21-2004 05:07 AM
disable title bar, status bar, and address bar of a browser window Matt ASP .Net 0 08-21-2004 03:50 AM



Advertisments