Can text display of the bulletin bar JS Code _ Typical effects

Source: Internet
Author: User
A text can be displayed in the bulletin board, can be used in many places, absolutely not to miss!
Script Description:
The first step: Add the following code to the <script language= "JavaScript" >
<!--Activate cloaking Device
var i = 0;
Used to cycle thru messages
var textnumber =-1;
Array of messages
var TextInput = new Object ();
Used to load manipulate message
var helptext= "";
Used to load message
var Text = "";
Length of timeout (smaller is faster)
var speed=50;
Used to display message number
var message=0;
Used to position text in ver 2.0
var addpadding= "RN";
Each element of TextInput represents a single.
Textinput[0] = "Today noticed a new task arrangement";
TEXTINPUT[1] = "Welcome to your visit!" This site for you to provide a large number of JavaScript download ";
TEXTINPUT[2] = "focus on JavaScript";
TEXTINPUT[3] = "technology closely related to making web effects";
TEXTINPUT[4] = "The site also has audio-visual space and other columns";
TEXTINPUT[5] = "There is also information on the news and health";
TEXTINPUT[6] = "There is also a large number of broadband network technology articles";
TEXTINPUT[7] = "site: http://www.njcatv.net";
Totaltextinput = 7; (0, 1, 2, 3, 4, 5, 6, 7)
Positioning and speed vary between versions.
var Version = navigator.appversion;
if (version.substring (0, 1) ==3)
{
speed=200;
Addpadding= "";
}
for (var addpause = 0; addpause <= totaltextinput; addpause++)
{Textinput[addpause]=addpadding+textinput[addpause];}
var Timerid
var Timerset=false;
Called by >>> button (display next message).
function Nextmessage ()
{
if (! Timerset)
{
Timerset=true;
Cleartimeout (Timerid);
if (textnumber>=totaltextinput)
{
Alert ("This is the list!");
Timerset=false;
}
Else
{
Textnumber+=1;
message=textnumber+1;
Document.forms[0].elements[2].value= message;
Text = Textinput[textnumber];
HelpText = Text;
}
Teletype ();
}
}
Gets and displays character from Rollmessage ().
Variable Speed controls length of timeout and thus the Speed of typing.
function Teletype ()
{
if (Timerset)
{
Text=rollmessage ();
Timerid = settimeout ("teletype ()", Speed);
Document.forms[0].elements[0].value=text;
}
}
Pulls one character at a time from string and returns (as Text) to function teletype () for displaying.
function Rollmessage ()
{
i++;
var checkspace = helptext.substring (i-1, i);
Checkspace = "" + checkspace;
if (Checkspace = "")
{i++;}
if (i >= helptext.length+1)
{
Timerset=false;
Text = helptext.substring (0, I);
i=0;
return (Text);
}
Text = helptext.substring (0, I);
return (Text);
}
Initially called by the OnLoad in the body tag to load title.
function Initteletype ()
{
text= "RN Manual tele-type Display";
Document.forms[0].elements[0].value=text;
}
Called by <<< button (get previous message).
function Lastmessage ()
{
if (! Timerset && Textnumber!=-1)
{
Timerset=true;
Cleartimeout (Timerid);
if (textnumber<=0)
{
Alert ("This is the beginning of the list!");
Timerset=false;
}
Else
{
Textnumber-=1;
message=textnumber+1;
Document.forms[0].elements[2].value= message;
Text = Textinput[textnumber];
HelpText = Text;
}
Teletype ();
}
}
Deactivate Cloaking--></script>
Step Two: Add the following code to the <body> area:
<form>
<table cellspacing= "0" cellpadding= "0" width= "17%" >
<tr>
&LT;TD width= "100%" colspan= "3" valign= "Top" ><div "center" align= ><p><textarea "Name=" ROWS = "3" cols= "wrap=" "Yes" ></textarea> </td>
</tr>
&LT;TR align= "center" >
&LT;TD width= "40%" valign= "Top" bgcolor= "#0000A0" ><input type= "button" value= "bulletin Board" onclick= "Lastmessage ()" > </td>
&LT;TD width= "30%" bgcolor= "#0000A0" valign= "Top" ><input type= "text" value= "Total 8" size= "5" name= "1" ></td >
&LT;TD width= "30%" bgcolor= "#0000A0" valign= "Top" ><input type= "button" value= "read" onclick= "Nextmessage" () "> </td>
</tr>
</table>
</form>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.