⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 you4.htm

📁 javascript各种效果的实例及源代码
💻 HTM
字号:
<html>
<head>
<title>测试点击速度</title>
<style type="text/css">
<!--
body {  font-family: "宋体"; font-size: 9pt; margin-top: 0px; margin-left: 0px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
 A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active     { font: 9pt "宋体"; cursor: hand; color: #FF0033 }

-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Tomer Shiran

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var total = 0
var play = false
function display(element) {
var now = new Date()
if (!play) {
play = true
startTime = now.getTime()}
if (now.getTime() - startTime > 20000) {
element.checked = !element.checked
return
}
 if (element.checked)
total++
else
total--
element.form.num.value = total
}
function restart(form) {
total = 0
play = false
for (var i = 1; i <= 100; ++i) {
 form.elements[i].checked = false
   }
}
// End -->
</SCRIPT>
</head>
<body bgcolor="#fef4d9">
<br>
<br>
<center><font color=red face="隶书" size=6>测试点击速度</font></center>
<br>
<center>

<br>
<br>
<center>
<table border=5 bordercolor=blue borderlight=green>
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong>下面为效果显示区!</strong></font></td></tr><tr><td align=center height=100>
<CENTER>测试一下你点击的速度与准确性,看看你在20秒内能点中多少个框</CENTER>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<FORM><CENTER>")
document.write('<INPUT TYPE="text" VALUE="0" ');
document.write('NAME="num" SIZE=10 onFocus="this.blur()"><BR>')
document.write("<HR SIZE=1 WIDTH=40%>")
for (var i = 0; i < 10; ++i) {
for (var j = 0; j < 10; ++j) {
document.write('<INPUT TYPE="checkbox" ');
document.write('onClick="display(this)">')}
document.write("<BR>")}
document.write("<HR SIZE=1 WIDTH=40%>")
document.write('<INPUT TYPE="button" VALUE="restart" ');
document.write('onClick="restart(this.form)">')
document.write("</CENTER></FORM>")
// End -->
</SCRIPT>
</td></tr>
</table></center>
<br>
<br>
<center>
<textarea name=source rows=12 cols=45 class=yk9>
脚本说明:
第一步:把如下代码加入<head>区域中
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Tomer Shiran

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var total = 0
var play = false
function display(element) {
var now = new Date()
if (!play) {
play = true
startTime = now.getTime()}
if (now.getTime() - startTime > 20000) {
element.checked = !element.checked
return
}
 if (element.checked)
total++
else
total--
element.form.num.value = total
}
function restart(form) {
total = 0
play = false
for (var i = 1; i <= 100; ++i) {
 form.elements[i].checked = false
   }
}
// End -->
</SCRIPT>



第二步:把如下代码加入<body>区
<CENTER>Test your skill.  How many boxes can 
you check in 20 seconds?</CENTER>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
document.write("<FORM><CENTER>")
document.write('<INPUT TYPE="text" VALUE="0" ');
document.write('NAME="num" SIZE=10 onFocus="this.blur()"><BR>')
document.write("<HR SIZE=1 WIDTH=40%>")
for (var i = 0; i < 10; ++i) {
for (var j = 0; j < 10; ++j) {
document.write('<INPUT TYPE="checkbox" ');
document.write('onClick="display(this)">')}
document.write("<BR>")}
document.write("<HR SIZE=1 WIDTH=40%>")
document.write('<INPUT TYPE="button" VALUE="restart" ');
document.write('onClick="restart(this.form)">')
document.write("</CENTER></FORM>")
// End -->
</SCRIPT>
</textarea>
<SCRIPT LANGUAGE="JavaScript">

<!-- hide

function goHist(a) 

{

   history.go(a);

}

//-->

</script>

<FORM METHOD="post">
<INPUT TYPE="button" VALUE="返回" onClick="goHist(-1)" style="background-color: #8000FF; color: rgb(255,255,255)">
</form>
</center>
<br>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -