<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<script language="JavaScript">
var tms = [];
var day = [];
var hour = [];
var minute = [];
var second = [];
function takeCount() {
setTimeout("takeCount()", 1000);
for (var i = 0, j = tms.length; i < j; i++) {
tms[i] -= 1000;
//计算天、时、分、秒、
var days = Math.floor(tms[i] / (1000 * 60 * 60 * 24));
var hours = Math.floor(tms[i] / (1000 * 60 * 60)) % 24;
var minutes = Math.floor(tms[i] / (1000 * 60)) % 60;
var seconds = Math.floor(tms[i] / 1000) % 60;
if (days < 0)
days = 0;
if (hours < 0)
hours = 0;
if (minutes < 0)
minutes = 0;
if (seconds < 0)
seconds = 0;
//将天、时、分、秒插入到html中
document.getElementById(day[i]).innerHTML = days;
document.getElementById(hour[i]).innerHTML = hours;
document.getElementById(minute[i]).innerHTML = minutes;
document.getElementById(second[i]).innerHTML = seconds;
}
}
setTimeout("takeCount()", 1000);
</script>
<div>
<ul>
<li style="width: 300px;">剩余时间: <span id="d1" style="font-weight: bold">0</span> <span>
天 </span><span id="h1" style="font-weight: bold">0</span> <span>小时 </span><span id="m1"
style="font-weight: bold">0</span> <span>分 </span><span id="s1" style="font-weight: bold">
0</span> <span>秒</span></li>
<script type="text/javascript">
tms[tms.length] = "333334444";
day[day.length] = "d1";
hour[hour.length] = "h1";
minute[minute.length] = "m1";
second[second.length] = "s1";
</script>
团购倒计时代码 阿里巴巴自定义版块没有用 ,为什么会自动过滤啊,要怎么改才有用呢
答案:2 悬赏:20 手机版
解决时间 2021-02-01 07:00
- 提问者网友:姑娘长的好罪过
- 2021-01-31 23:30
最佳答案
- 五星知识达人网友:骨子里都是戏
- 2021-02-01 00:00
阿里商铺是不能写JS的
全部回答
- 1楼网友:等灯
- 2021-02-01 01:02
支持一下感觉挺不错的
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯