js代码倒计时

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<html>
<head>
<title>js倒计时代码 – k686绿色软件 – http://www.k686.com</title>
<meta name=”Generator” content=”EditPlus”>
<meta name=”Author” content=”k686绿色软件 http://www.k686.com”>
<meta name=”Keywords” content=”绿色软件”>
<meta name=”Description” content=”绿色软件”>

</head>

<body>
k686绿色软件 – http://www.k686.com
<script>
function countDown( maxtime,fn )
{
var timer = setInterval(function()
{
if(maxtime>=0){
minutes = Math.floor(maxtime/60);
seconds = Math.floor(maxtime%60);
msg = “距离结束还有”+minutes+”分”+seconds+”秒”;
fn( msg );
if(maxtime == 5*60) alert(‘注意,还有5分钟!’);
–maxtime;
}
else{
clearInterval( timer );
fn(“时间到,结束!”);
}
}, 1000);
}
</script>

来源:liuyunlonglong_33

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2011年4月16日
下一篇 2011年4月16日

相关推荐