Automatically output page text with JavaScript

Source: Internet
Author: User
Javascript| Web page

In the Web page often people use swish to do text output typing effect, in fact, JavaScript can make that effect, as shown in the following ways to add JavaScript code in the HTML file.

The first step: Add the following code to the

<script language= "JavaScript"
<!--Original: Tarjei Davidsen (the@rescueteam.com)
<!--This script and many more are available free online at;
& lt;! --The JavaScript source!! Http://javascript.internet.com
<!--Begin
var max=0

Function textlist () {

Max=textlist.arguments.length;

for (i=0; i<max; i++)

This[i]=textlist.arguments[i];

TL = new Textlist ("Enter text to output here");

var x = 0; pos = 0;

var L = tl[0].length;

Function Textticker () {

Document.tickform.tickfield.value = tl[x].substring (0, POS) + "_";

if (pos++ = = L) {

pos = 0;

SetTimeout ("Textticker ()");

if (++x = max) x = 0;

L = tl[x].length;

} else

settimeout ("Textticker ()");}

//end--></script>

Step Two: Add the following code to the <body> area

<form name=tickform>

<textarea Name=tickfield rows=3 cols=38 style= "Background-color:rgb (0,0,0); Color:rgb (255,255,255); Cursor:default; font-family:arial; FONT-SIZE:12PX "Wrap=virtual>the News would appear here the page has finished LOADING.</TEXTAREA></FORM&G T

Step Three: change <body> to <body bgcolor= "#fef4d9" >

OK, that's it!



Related Article

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.