`
ykyfendou
  • 浏览: 403271 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

js特效--打字速度测试

阅读更多

样式:



 

 

HTML代码:

<!-- 打字速度测试 -->
 <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
msg = new Array("Practicing with your typing can greatly help your overall computer skills.",
"A new computer is sold in the US every hour!",
"When do birds migrate from North to South?",
"Perplexing phrases, like this one, are tougher to type.")
word = 10
function m() {
msg = new Array("Practicing with your typing can greatly help your overall computer skills.",
"A new computer is sold in the US every hour!",
"When do birds migrate from North to South?",
"Perplexing phrases, like this one, are tough to type.")
word = 10
}
function e() {
msg = new Array("If you can correctly, and quickly, type this perplexing sentence, you are one superb typist!",
"You are one superb typist if you can correctly, and quickly, type this long phrase.",
"I believe you're a good typist, so I believe you will correctly copy this statement!",
"Because this is not a fairly simple phrase, could you swiftly, and precisely, copy it?")
word = 15
}
function s() {
msg = new Array("Computers are the medium of the future.",
"Can you type this phrase rather quickly?",
"Who is the President of the US?",
"I believe that you can type well!")
word = 7
}
function beginIt() {
randNum = Math.floor((Math.random() * 10)) % 4
msgType = msg[randNum]
day = new Date();
startType = day.getTime();
document.theForm.given.value = msgType
document.theForm.typed.focus();
document.theForm.typed.select();
}
function cheat() {
alert("对不起,这里的内容你不能改变!!");
document.theForm.typed.focus();
}
function stopIt() {
dayTwo = new Date();
endType = dayTwo.getTime();
totalTime = ((endType - startType) / 1000)
spd = Math.round((word/totalTime) * 60)
if (document.theForm.typed.value == document.theForm.given.value) {
alert("\n你输入了 " + word + " 个字符,在 " 
+ totalTime + " 秒内, 速度为每秒钟 " + spd + " 个字符!")
}
else {
alert("你输入有错,但是你每分钟输入 " + spd + " 个字符.")
   }
}
// End -->
</SCRIPT>
<div style="position: absolute;top: 900px">
<FORM name="theForm">
<TABLE BORDER=3 CELLSPACING=0 CELLPADDING=0>
<TR>
<TD>你是个...</TD>
<TD align=center><input type=radio name="sme" value="Beginner" onClick="s()" checked>初级者
<input type=radio name="sme" value="Novice" onClick="m()">中级者
<input type=radio name="sme" value="Expert" onClick="e()">高级者</TD>
</TR>
<TR><TD colspan=2><BR>
<center><input type=button value="开始测试" name="start" onClick="beginIt()"></center><P>
<textarea name="given" cols=53 rows=3 wrap=on onFocus="cheat()"></textarea></TD>
</TR>
<TR><TD colspan=2><center><input type=text name="typed" size=45>
<input type=button value="完成"  name="stop"  onClick="stopIt()"></center></TD>
</TR>
</TABLE></FORM>
</div>

 

  • 大小: 59.1 KB
分享到:
评论

相关推荐

    javascript经典特效---测试打字速度.rar

    测试打字速度.rar测试打字速度.rar测试打字速度.rar测试打字速度.rar测试打字速度.rar测试打字速度.rar

    js 特效 html 特效 测试打字速度

    js 特效 html 特效 测试打字速度 js 特效 html 特效 测试打字速度

    js网页特效打字测速

    本程序为网页版打字速度测试,采用javascript编写,适合于课程设计交作业。本程序为网页版打字速度测试,采用javascript编写,适合于课程设计交作业。本程序为网页版打字速度测试,采用javascript编写,适合于课程...

    js网页打字速度测试

    js网页打字速度测试

    javascript网页特效实例大全

    10.3 打字速度测试 264 10.4 改变图片提示背景颜色 266 10.5 渐变色表格 269 10.6 列表内容相互转换 270 10.7 身体健康测试 273 10.8 网络知识测试 275 10.9 方框线上的闪耀效果 278 10.10 自动隐藏的菜单 ...

    HTML5键盘打字速度测试代码

    HTML5键盘打字速度测试代码是一款简单的从A到Z英文字母键盘打字速度测试游戏源代码下载。

    程序天下:JavaScript实例自学手册

    第1章 页面特效 1.1 HTML页面反向显示 1.2 页面自动最大化 1.3 页面自动刷新 1.4 页面的后退、刷新、前进 1.5保护网页源代码 1.6 保护自己的网页不被放入框架 1.7 保护自己的网页不被放入框架 1.8 打印页面的出错...

    《程序天下:JavaScript实例自学手册》光盘源码

    第1章 页面特效 1.1 HTML页面反向显示 1.2 页面自动最大化 1.3 页面自动刷新 1.4 页面的后退、刷新、前进 1.5保护网页源代码 1.6 保护自己的网页不被放入框架 1.7 保护自己的网页不被放入框架 1.8 打印页面的出错...

    超实用的jQuery代码段

    11.27 使用递归函数创建文字闪烁特效 11.28 使用ID选择器加快选择的速度 11.29 在类选择器前用标签选择器加快速度 11.30 缓存jQuery对象以提升性能 11.31 使用find()函数提升子查询的性能 11.32 使用jQuery操作DOM...

Global site tag (gtag.js) - Google Analytics