团购限时抢购时间显示程序
2012-06-13 16:26
357 查看
<!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=utf-8" />
<title>团购倒计时</title>
<script src=\'#\'" //liuxiaofan.com/demo/jquery-1.6.4.min.js" type="text/javascript"></script>
<script>
var endtimes=new Array();//结束时间
endtimes[0]="12/06/2011 9:03:00";
endtimes[1]="11/16/2011 9:24:20";
endtimes[2]="12/08/2011 9:05:00";
endtimes[3]="04/09/2011 9:15:00";
endtimes[4]="12/06/2011 6:03:00";
endtimes[5]="11/16/2011 3:04:20";
endtimes[6]="12/08/2011 2:05:00";
endtimes[7]="04/09/2012 5:05:00";
var nowtimes;
function givetime(){
nowtimes=new Date("11/07/2011 9:03:00");//当前服务器时间
DownCount();
};
function DownCount(){
nowtimes=Number(nowtimes)+1000;
for(var i=0;i<=7;i++)//设置一共有多少个商品
{
var theDay=new Date(endtimes[i]);
theDay=theDay++;
if(theDay<=nowtimes)
{
$(".times"+i).each(function(){$(this).find(".lxfTCD_day").text(00);$(this).find(".lxfTCD_hour").text(00);$(this).find(".lxfTCD_minute").text(00);$(this).find(".lxfTCD_second").text(00);});
}
else{
timechange(theDay,i);
};
};
window.setTimeout("DownCount()",1000);
};
function timechange(theDay,i){
var theDays=new Date(theDay);
var seconds = (theDays - nowtimes)/1000;
var minutes = Math.floor(seconds/60);
var hours = Math.floor(minutes/60);
var days = Math.floor(hours/24);
var CDay= days ;
var CHour= hours % 24;
var CMinute= minutes % 60;
var CSecond= seconds % 60;
if(CMinute<10) {CMinute="0"+CMinute;};
if(CHour<10) {CHour="0"+CHour;};
if(CSecond<10) {CSecond="0"+CSecond;} ;
$(".times"+i).each(function(){$(this).find(".lxfTCD_day").text(CDay);$(this).find(".lxfTCD_hour").text(CHour);$(this).find(".lxfTCD_minute").text(CMinute);$(this).find(".lxfTCD_second").text(CSecond);});
};
$(function(){
givetime();//执行函数
});
</script>
<style type="text/css">
<!--
* { font-style: normal; font-size:12px; color:#333}
span{ font-size:20px; font-weight:bold;}
-->
</style>
</head>
<body>
<div class="times0" >
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">24</span><em>时</em>
<span class="lxfTCD_minute">35</span><em>分</em>
<span class="lxfTCD_second">01</span><em>秒</em>
</div>
<div class="times1" >
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">24</span><em>时</em>
<span class="lxfTCD_minute">35</span><em>分</em>
<span class="lxfTCD_second">01</span><em>秒</em>
</div>
<div class="times2">
<i>剩余时间:</i>
<span class="lxfTCD_day">12</span><em>天</em>
<span class="lxfTCD_hour">12</span><em>时</em>
<span class="lxfTCD_minute">15</span><em>分</em>
<span class="lxfTCD_second">06</span><em>秒</em>
</div>
<div class="times3">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times4">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times5">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times6">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times7">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>团购倒计时</title>
<script src=\'#\'" //liuxiaofan.com/demo/jquery-1.6.4.min.js" type="text/javascript"></script>
<script>
var endtimes=new Array();//结束时间
endtimes[0]="12/06/2011 9:03:00";
endtimes[1]="11/16/2011 9:24:20";
endtimes[2]="12/08/2011 9:05:00";
endtimes[3]="04/09/2011 9:15:00";
endtimes[4]="12/06/2011 6:03:00";
endtimes[5]="11/16/2011 3:04:20";
endtimes[6]="12/08/2011 2:05:00";
endtimes[7]="04/09/2012 5:05:00";
var nowtimes;
function givetime(){
nowtimes=new Date("11/07/2011 9:03:00");//当前服务器时间
DownCount();
};
function DownCount(){
nowtimes=Number(nowtimes)+1000;
for(var i=0;i<=7;i++)//设置一共有多少个商品
{
var theDay=new Date(endtimes[i]);
theDay=theDay++;
if(theDay<=nowtimes)
{
$(".times"+i).each(function(){$(this).find(".lxfTCD_day").text(00);$(this).find(".lxfTCD_hour").text(00);$(this).find(".lxfTCD_minute").text(00);$(this).find(".lxfTCD_second").text(00);});
}
else{
timechange(theDay,i);
};
};
window.setTimeout("DownCount()",1000);
};
function timechange(theDay,i){
var theDays=new Date(theDay);
var seconds = (theDays - nowtimes)/1000;
var minutes = Math.floor(seconds/60);
var hours = Math.floor(minutes/60);
var days = Math.floor(hours/24);
var CDay= days ;
var CHour= hours % 24;
var CMinute= minutes % 60;
var CSecond= seconds % 60;
if(CMinute<10) {CMinute="0"+CMinute;};
if(CHour<10) {CHour="0"+CHour;};
if(CSecond<10) {CSecond="0"+CSecond;} ;
$(".times"+i).each(function(){$(this).find(".lxfTCD_day").text(CDay);$(this).find(".lxfTCD_hour").text(CHour);$(this).find(".lxfTCD_minute").text(CMinute);$(this).find(".lxfTCD_second").text(CSecond);});
};
$(function(){
givetime();//执行函数
});
</script>
<style type="text/css">
<!--
* { font-style: normal; font-size:12px; color:#333}
span{ font-size:20px; font-weight:bold;}
-->
</style>
</head>
<body>
<div class="times0" >
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">24</span><em>时</em>
<span class="lxfTCD_minute">35</span><em>分</em>
<span class="lxfTCD_second">01</span><em>秒</em>
</div>
<div class="times1" >
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">24</span><em>时</em>
<span class="lxfTCD_minute">35</span><em>分</em>
<span class="lxfTCD_second">01</span><em>秒</em>
</div>
<div class="times2">
<i>剩余时间:</i>
<span class="lxfTCD_day">12</span><em>天</em>
<span class="lxfTCD_hour">12</span><em>时</em>
<span class="lxfTCD_minute">15</span><em>分</em>
<span class="lxfTCD_second">06</span><em>秒</em>
</div>
<div class="times3">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times4">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times5">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times6">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
<div class="times7">
<i>剩余时间:</i>
<span class="lxfTCD_day">10</span><em>天</em>
<span class="lxfTCD_hour">08</span><em>时</em>
<span class="lxfTCD_minute">34</span><em>分</em>
<span class="lxfTCD_second">03</span><em>秒</em>
</div>
</body>
</html>
相关文章推荐
- js显示当前时间(动态)以及限时抢购倒计时
- caffe 训练中在屏幕上显示程序运行的时间
- seg显示时间——51程序
- 限时抢购团购倒计时活动完整js代码
- 简单小程序获取显示当前时间
- 显示程序执行时间php函数代码
- C# 调用 Emgu.CV 显示RTSP流 + 设置程序运行超时时间
- Matlab中计算程序显示运行时间的几种方法
- Java中几个关于时间的程序:万年历、Zeller公式、显示当前时间
- 用java swing写的一个显示时间和实时天气的小程序
- 在JSP页面中通过JS动态显示时间程序
- java的显示时间的程序
- 限时团购,6.9折:《微信开发深度解析:公众号、小程序高效开发秘籍》推荐序
- 使用mysql-front的时候遇到显示:程序注册时间到期程序将被限制模式下运行
- 帖一个根据服务器时间作为起始,显示时钟的小程序
- 在微信小程序中实现时间日期的选择,并且显示当前选择的时间日期
- 网页中实现一个计算当年还剩多少时间的倒数计时程序,要求网页上实时动态显示“××年还剩××天××时××分××秒”
- 显示现在时间的小程序
- 第十五篇、程序返回前台的时间差(常用于显示广告)
- 控制台程序动态显示时间