62,271
社区成员
发帖
与我相关
我的任务
分享<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
var time; //计时器
var minute = 22;
var second = 60;
var showTime =minute + "分" + second + "秒"; //显示时间
function setTime(){
second--;
if(second == -1){
minute--;
second = 59;
}
if(minute == -1){
hour--;
minute = 59;
}
if((minute == 0) && (second == 0)){
clearTimeout(time); //清除计时器
}else{
showTime =minute + "分" + second + "秒";
time = setTimeout('setTime()', 1000);
}
document.all("lblTime").innerText = showTime;
}
onload = function(){
document.all("lblTime").innerText = showTime;
time = setTimeout('setTime()', 1000);
}
</script>
<body>
<span id= "lblTime"> </span>
</body>
</html>