Js status bar typewriter effect

Source: Internet
Author: User
Tip: you can modify some code before running

<script Language="JavaScript">Var msg = "effect! "; Interval = 200<!--定义打字效果的时间间隔-->Var seq = 0;<!--定义当前显示的字符的个数-->Function Scroll () {len = msg. length;<!--获得待显示文字的长度-->Window. status = msg. substring (0, seq + 1 );<!--显示第一个字符-->Seq ++;<!--seq加1-->If (seq> = len ){<!--如果seq大于文字长度,则将它置0-->Seq = 0; window. status = '';<!--清空状态栏-->} Elsewindow. setTimeout ("Scroll ();", interval );<!--每个0.2秒调用一次scroll函数-->} Scroll ();<!--直接调用scroll()函数--></script><!--本例程实现了状态栏中以打字效果显示的文字的功能--><!--状态栏的操作函数--><!--字符串的循环表示--><!--settimeout函数的使用-->
Tip: you can modify some code before running

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.