JavaScript implementation TEXTAREA typewriter effect hint

Source: Internet
Author: User
Tags flush

Very good prompt input content, dynamic hints, give people intimacy

<textarea id= "Content" name= "Content" cols= "5" rows= "style=" width:450px;height:50px "class=" text "onchange=" Checkcontent () "onclick=" Javascript:flush (); ></textarea>
<script language= "javascript" type= "Text/javascript" >
function $ (ID) {return document.getElementById (ID);}
var msgall= "Strive to build excellent programming learning station." "
var msg = "Enter the question content, click" I want to ask questions. " ;
var interval = 100
var spacelen = 100;
var space10= "";
var seq=0;
var cont=true
function Scroll () {
len = msg.length;
$ ("content"). Value = msg.substring (0, seq+1);
seq++;
if (seq >= len) {
seq = 0;
var per=math.round (Math.random () * (5-1)) +1;
Switch (PER) {
Case 1:msg= "Programming introductory network www.bianceng.cn hint information one";
Case 2:msg= "Hint Information 2 introductory network www.bianceng.cn";
Case 3:msg= "Hint Information 3 introductory network www.bianceng.cn";
Case 4:msg= "Hint Information 4 introductory network www.bianceng.cn";
Case 5:msg= "Hint Information 5 introductory network www.bianceng.cn";
}
if (cont) {
Window.xywtimeout ("Scroll ();", interval);
}
else{
$ ("content"). value= "";
}
}
Else
if (cont) {
Window.xywtimeout ("Scroll ();", interval);
}
else{
$ ("content"). value= "";
}
}
Scroll ();
function Flush () {
$ ("content"). value= "";
Cont=false;
$ ("content"). Onclick=function () {return void (0);};
}
</script>

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.