var off_x; Horizontal axis var count=0; Total score var speed=5000;
Speed, the default is 5 seconds. var keyerro=0; Input error times Var keyright=0; Enter the correct number of times/organization letter Var chararray=new Array ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P"
, "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");
Key-coded array var arrcode=new array ();
for (Var i=65;i<=90;i++) {arrcode[i-65]=i;
///random production of one letter Var randomchar=function () {off_x=math.random () *500+5;//in Div horizontal//off_y=math.random () *500-10;//in Div ordinate var c=chararray[parseint (Math.random () *25)]; Randomly generated one letter var charhtml= "<div class= ' char ' id= '" +c+ "' style= ' Left:" +off_x+ "Px;color:" +colorbox () + "' >" +c+ "<
/div> ";
$ ("#div1"). Append (charhtml);
};
var colorbox=function () {color=[];/////////////////"#ff2211" with array of colors color[0]=;
Color[1]= "#ff3311";
Color[2]= "#ff5511";
Color[3]= "#ff8811";
Color[4]= "#ffBB99";
Color[5]= "#1ff4f1";
Color[6]= "#ff5566";
Color[7]= "#668899";
Color[8]= "#99BBfA";
Color[9]= "#fECECC"; Return Color[parseint (Math.random () *10)];Randomly born color. ///Every three seconds call some methods to produce the letter function Accruechar () {///put the random out in the animation queue Var _sildefun=[//The animation to be executed in sequence in an array function () {$ (' #div1 di
V '). Animate ({top: ' +=470px '},speed,function () {///when the animation is finished, delete $ (this). Remove ();
count-=10;
$ ("input[type= ' text ']"). attr ({"Value": count});
});}
];
Put the function group into the Slidelist animation queue $ ("#div1"). Queue (' Slidelist ', _sildefun);
var _takestart=function () {//Removes a queue function from the front end of the queue and executes it.
$ ("#div1"). Dequeue ("Slidelist");
};
function Randcharhandle () {Randomchar ();
_takestart ();
} randcharhandle ();
}//Health Code processing function KeyCode (event) {var keyvalue = Event.keycode;
var Flag=false;
alert (keyvalue); for (Var i=0;i<=arrcode.length;i++) {if (keyvalue==arrcode[i]&&$ ("#" +chararray[i]+ ""). Text ()!= "") {//
Select pairs to stop for one second ("#" +chararray[i]+ ""). Stop (1000). Remove ();
Choose the right to add 10 points count+=10;
$ ("input[type= ' text ']"). attr ({"Value": count});
$ ("#right"). Text (keyright);
Flag=true;
Break
} if (flag) {flag=false;
keyright++;
$ ("#right"). Text (keyright); }else{Keyerro++;
$ ("#erro"). Text (Keyerro);
} $ (function () {//Acceleration $ ("input[value= ' acceleration + + ']"). Click (function () {if (speed>0) speed-=1000;
});
Deceleration $ ("input[value= ' deceleration--']"). Click (function () {speed+=1000;
});
}); Window.setinterval ("Accruechar ()", 1500);
/*******************************************html page ***************************************************/