无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<!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>
<style>
#lefttime3 { background: url(timerbg.jpg) no-repeat left center; width:1018px;height:55px;
font-size:40px;line-height: 55px;font-family: MS Yahei,Microsoft YaHei;
color: #f00;color:rgb(255,205,1);
}
#day{ margin-left: 592px;}
#hour { margin-left:40px; }
#min { margin-left: 39px;}
#sec { margin-left: 37px;}
</style>
<script>
var djs = function(d,o)
{
var f = {
zero: function(n){
var n = parseInt(n, 10);
if(n > 0) {
if(n <= 9) n = '0' + n;
return String(n);
} else {
return '00';
}
},
run: function(){
var ts = Math.round((new Date(d).getTime() - new Date().getTime()) / 1000);
if(o && ts > 0)
{
var yy = Math.floor(ts / 31556926);
var mm = Math.floor(ts / 2629744); mm = mm > 0 ? mm%12 : '00';
var dd = Math.floor(ts / 86400); dd = dd > 0 ? dd%30 : '00';
var hh = Math.floor(ts / 3600); hh = hh > 0 ? hh%24 : '00';
var ii = Math.floor(ts / 60); ii = ii > 0 ? ii%60 : '00';
var ss = Math.floor(ts % 60);
if(o.y) o.y.innerHTML = f.zero(yy);
if(o.m) o.m.innerHTML = f.zero(mm);
if(o.d) o.d.innerHTML = f.zero(dd);
if(o.h) o.h.innerHTML = f.zero(hh);
if(o.i) o.i.innerHTML = f.zero(ii);
if(o.s) o.s.innerHTML = f.zero(ss);
}
window.setTimeout(f.run,1000);
}
}
f.run();
}
function ieFixed(id)
{
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var obj = document.getElementById(id).style;
if (isIE6 && obj)
{
obj.position = "absolute";
obj.bottom = "0px";
obj.right = "0px";
var tm = window.setInterval(function(){
obj.marginBottom = "0px";
obj.left = ( document.documentElement.scrollLeft + document.documentElement.clientWidth - 312) + "px";
}, 80);
}
}
</script>
</head>
<body style="height:300000px;">
<div id="lll" style="margin:10px;padding:20px; border:solid 2px #DDD; background:#fc6;height:300px;"></div>
<div id="lefttime3" style="position:fixed;bottom:0px;right:0px;"><span id="day"></span><span id="hour"></span><span id="min"></span><span id="sec"></span></div>
<script>
var d = new Date().getTime() + 3600*24*1000;
var d = 1379572933131;
var o = {
d: document.getElementById('day'),
h: document.getElementById('hour'),
i: document.getElementById('min'),
s: document.getElementById('sec')
}
djs(d,o);//倒计时
ieFixed('lefttime3'); //固定在底部
</script>
</body>
</html>
1)兼容IE6
2)自动倒计时,输入的数字必须是时间,单位毫秒。
<!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>
<style>
#lefttime3 { background: url(timerbg.jpg) no-repeat left center; width:1018px;height:55px;
font-size:40px;line-height: 55px;font-family: MS Yahei,Microsoft YaHei;
color: #f00;color:rgb(255,205,1);
}
#day{ margin-left: 592px;}
#hour { margin-left:40px; }
#min { margin-left: 39px;}
#sec { margin-left: 37px;}
</style>
<script>
var djs = function(d,o)
{
var f = {
zero: function(n){
var n = parseInt(n, 10);
if(n > 0) {
if(n <= 9) n = '0' + n;
return String(n);
} else {
return '00';
}
},
run: function(){
var ts = Math.round((new Date(d).getTime() - new Date().getTime()) / 1000);
if(o && ts > 0)
{
var yy = Math.floor(ts / 31556926);
var mm = Math.floor(ts / 2629744); mm = mm > 0 ? mm%12 : '00';
var dd = Math.floor(ts / 86400); dd = dd > 0 ? dd%30 : '00';
var hh = Math.floor(ts / 3600); hh = hh > 0 ? hh%24 : '00';
var ii = Math.floor(ts / 60); ii = ii > 0 ? ii%60 : '00';
var ss = Math.floor(ts % 60);
if(o.y) o.y.innerHTML = f.zero(yy);
if(o.m) o.m.innerHTML = f.zero(mm);
if(o.d) o.d.innerHTML = f.zero(dd);
if(o.h) o.h.innerHTML = f.zero(hh);
if(o.i) o.i.innerHTML = f.zero(ii);
if(o.s) o.s.innerHTML = f.zero(ss);
}
window.setTimeout(f.run,1000);
}
}
f.run();
}
function ieFixed(id)
{
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var obj = document.getElementById(id).style;
if (isIE6 && obj)
{
obj.position = "absolute";
obj.bottom = "0px";
obj.right = "0px";
var tm = window.setInterval(function(){
obj.marginBottom = "0px";
obj.left = ( document.documentElement.scrollLeft + document.documentElement.clientWidth - 312) + "px";
}, 80);
}
}
</script>
</head>
<body style="height:300000px;">
<div id="lll" style="margin:10px;padding:20px; border:solid 2px #DDD; background:#fc6;height:300px;"></div>
<div id="lefttime3" style="position:fixed;bottom:0px;right:0px;"><span id="day"></span><span id="hour"></span><span id="min"></span><span id="sec"></span></div>
<script>
var d = new Date().getTime() + 3600*24*1000;
var d = 1379572933131;
var o = {
d: document.getElementById('day'),
h: document.getElementById('hour'),
i: document.getElementById('min'),
s: document.getElementById('sec')
}
djs(d,o);//倒计时
ieFixed('lefttime3'); //固定在底部
</script>
</body>
</html>
1)兼容IE6
2)自动倒计时,输入的数字必须是时间,单位毫秒。
标签:
倒计时,固定底部
无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com
暂无评论...
更新日志
2024年10月04日
2024年10月04日
- 邓丽君.1983-漫步人生路(2024环球MQA-UHQCD限量版)【环球】【WAV+CUE】
- 陈容森.1996-情断【上华】【WAV+CUE】
- 裘海正.1994-爱我的人和我爱的人【上华】【WAV+CUE】
- 庾澄庆.1988-错过的爱【福茂】【WAV+CUE】
- 班得瑞原装进口《第十三张新世纪专辑:旭日之丘》1CD[APE/CUE分轨][329.6MB]
- 纯音入心系列纯音乐《古筝|佛蕴|境法禅心意法自然》1CD[MP3][350MB]
- 纪钧瀚《钢琴阅读时光 雨中书店聆听轻音乐》[320K/MP3][203.44MB]
- 群星.1981-名曲65(2014环球复黑王·百代篇)【EMI百代】【WAV+CUE】
- 陈淑桦.1990-娃娃的故事【柯达】【WAV+CUE】
- 戴梅君.2011-问签诗【美华】【WAV+CUE】
- 李国祥.1995-九五变奏【嘉音】【WAV+CUE】
- 许景淳.1992-你来自何方【全美唱片】【WAV+CUE】
- 石欣卉.2007-剧欣卉集·完整电视剧主题精丫华纳】【WAV+CUE】
- 群星.2005-LOVE情歌集VOL.5.2CD【正东】【WAV+CUE】
- 孙悦.1996-伙伴【正大国际】【WAV+CUE】