博主信息
博文 9
粉丝 0
评论 0
访问量 11139
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
简单的倒计时代码
程序员的博客
原创
2061人浏览过
<!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" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes" >
<title>倒计时代码精确到毫秒</title>
</head>
<body>
<style>
*{margin:0;padding:0}
ul,li{list-style-type:none;}
a{text-decoration:none;outline:none;}
img{border:0;outline:none;max-width:100%;}

.tima1{ display: block; max-width:640px; min-width:320px; width:100%; margin: 0 auto;}
.timeb{ font-weight: bolder; color: red; font-family: Microsoft Yahei; font-size: 105%; background:url(wapx.jpg) no-repeat; background-size:100%; position: fixed;}
.timeb img{ position:relative;}
#timeaa,#timebb,#timecc,#timedd{ position:absolute;}
#timeaa{ top:50%; left:26%;}
#timebb{ top:50%; left:43%;}
#timecc{ top:50%; left:58%;}
#timedd{ top:50%; left:75%;}
</style>
<a href="javascript:void(0)" onclick="openZoosUrl();" class="tima1">
<div class="timeb"><img src="wapx.jpg" />
<span id="timeaa">
<script language="javascript">
function _fresh()
{
 var endtime=new Date("2016/9/01,00:00:00");
 var nowtime = new Date();
 var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
 __d=parseInt(leftsecond/3600/24);
var c=new Date();
var q=((c.getMilliseconds())%10);
 document.getElementById("timeaa").innerHTML=__d;
 if(leftsecond<=0){
 document.getElementById("timeaa").innerHTML="";
 clearInterval(sh);
 }
}
_fresh()
var sh;
sh=setInterval(_fresh,100);
</script>
</span>
<span id="timebb">
<script language="javascript">
function _fresh()
{
 var endtime=new Date("2016/9/01,00:00:00");
 var nowtime = new Date();
 var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
 __h=parseInt((leftsecond/3600)%24);
var c=new Date();
var q=((c.getMilliseconds())%10);
 document.getElementById("timebb").innerHTML=__h;
 if(leftsecond<=0){
 document.getElementById("timebb").innerHTML="活动已结束";
 clearInterval(sh);
 }
}
_fresh()
var sh;
sh=setInterval(_fresh,100);
</script>
</span>
<span id="timecc">
<script language="javascript">
function _fresh()
{
 var endtime=new Date("2016/9/01,00:00:00");
 var nowtime = new Date();
 var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
 __m=parseInt((leftsecond/60)%60);
var c=new Date();
var q=((c.getMilliseconds())%10);
 document.getElementById("timecc").innerHTML=__m;
 if(leftsecond<=0){
 document.getElementById("timecc").innerHTML="活动已结束";
 clearInterval(sh);
 }
}
_fresh()
var sh;
sh=setInterval(_fresh,100);
</script>
</span>
<span id="timedd">
<script language="javascript">
function _fresh()
{
 var endtime=new Date("2016/9/01,00:00:00");
 var nowtime = new Date();
 var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
 __s=parseInt(leftsecond%60);
var c=new Date();
var q=((c.getMilliseconds())%10);
 document.getElementById("timedd").innerHTML=__s+"."+q;
 if(leftsecond<=0){
 document.getElementById("timedd").innerHTML="活动已结束";
 clearInterval(sh);
 }
}
_fresh()
var sh;
sh=setInterval(_fresh,100);
</script>
</span>
</div>
</a>
</body>
</html>
本博文版权归博主所有,转载请注明地址!如有侵权、违法,请联系admin@php.cn举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
作者最新博文
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学