怎么用setTimeout()做秒表?

来源:百度知道 编辑:UC知道 时间:2024/07/02 20:09:56
点下开始按钮开始计时(秒) 再点暂停按钮就停止
谢谢哈

以下是个JS做的秒表 空格开始 再空格结束

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>秒表 Stopwatch for Rubik's Cube China</title>
</head>
<style>
td,input,div,th{font:9pt verdana}
p {line-height:60%}

</style>
<body onkeyup="begin(event)" onkeydown="stop(event)" onload=rndCube()>
<script type=text/javascript>
var Max=25;
var bestAve;
var then;
var nowDec;
var nowBest;
var nowWorst;
var runing=0;
var timeint;
var i=0;
var totalsec;
var sec;
var min;
var subsec;
var secdis;
var mindis;
var subsecdis;
var datas=new Array()
var nowSecondes;
function getAv(st,ed)
{
for(i=st;i<=ed;i++)
{
datas.join(" ")

}
}
function stop(evt)
{
if