Text Scroller: Freeware by Eli Fenton


Text scroller will scroll text in a textbox of your choice. To run this script when loading your document, use the following:

<BODY onLoad="javascript:scroll(document.formname.boxname, 100, 'this is the text')">

There are three parameters to the "scroll" function:

  1. The name of the scroll-box in your document. Replace "formname" with the NAME value of the form, and "boxname" with the NAME value of the text-box. If your scroll-box is in a frame, you should replace "document" with the name of the frame.
  2. The speed of the text-box, in milliseconds per update. The smaller, the faster.
  3. The scroll-string. If this is longer than 255 characters, you should end the quotes, type a '+' character, and continue the quotes every 255 characters. This will ensure that your scroll-box will work with every browser.

Just put the following code in your <HEAD> section.

<SCRIPT LANGUAGE="javaScript">
// Text Scroller: Freeware by Eli. www.zioth.com/javascript
var GBox;var GSpeed;function spc(n){return(n?' '+spc(n-1):'')}
function scrollR(s) {GBox.value=s;setTimeout("scrollR('" + (s.substring(1,s.length)+s.substring(0,1))+"')",GSpeed);}
function scroll(b,p,s){GBox=b;GSpeed=p;scrollR(spc(b.size*2+10) + s);}
</SCRIPT>

and then, somewhere on your page, add something similar to the following:

<FORM NAME="sFrm">
<P ALIGN=
"center">
<INPUT TYPE=
"text" NAME="sBox" VALUE="s" SIZE="36">
</FORM>

 

Return to the JavaScript page
Visit Zioth.com