Tip: You can modify some of the code before running
<ptml> <pead> <title>js input text box typing effect code </title> <style> box {font-size:20; color:red} &L t;/style> <script language= "JavaScript" > var max=0; function textlist ()//own object, storage string {max=textlist.arguments.length; for (i=0; i<max; i++) this[i]=textlist.arguments[i]; Tl=new textlist//is actually a multidimensional array tl[0]= "Welcome to JavaScript Scripting Hundred" The rest of the analogy ("Welcome to JavaScript scripting", "this chapter mainly explains how to handle text effects with JavaScript", " This example implements the typewriter effect in a text box "); var x=0; pos=0; var l=tl[0].length; function Textticker () {document.form1.textfeld.value=tl[x].substring (0,pos) + "_"; if (pos++==l) {pos=0; SetTimeout ("Textticker ()", 1000); Control the conversion time between two paragraphs x + +; if (X==max) x=0; L=tl[x].length; else settimeout ("Textticker ()", 130); Control the display time between text} </script> </pead> <body onload= "Textticker ()" > <center> </p> <form Name= "Form1" method= "get" > <center> <p> <input class=box type= "text" name= "Textfeld" size= "+" > & Lt;/p> </FOrm> </center> </body> </ptml></td> </tr> </table>
Tip: You can modify some of the code before running