渡//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
無標題文件 #lefttime3 { 背景:url(timerbg.jpg) 左中心不重複;寬度:1018 像素;高度:55 像素;
字體大小:40px;行高:55px;字體系列:MS雅黑,微軟雅黑;
顏色:#f00;顏色:rgb(255,205,1);
}
#day{ margin-left: 592px;}
#hour { margin-left:40px;}
#hour { margin-left:40px;} }
#min { margin-left: 39px;}
#sec { margin-left: 37px}
;
var djs = function(d,o)
{
var f = {
零:函數(n){
var n = parseInt(n, 10);
if(n > 0) {
if(n 回傳字串(n);
} else {
回傳'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);毫米=毫米> 0 ?毫米:'00';
var dd = Math.floor(ts / 86400); dd=dd> 0 ? dd0:'00';
var hh = Math.floor(ts / 3600); hh=hh> 0 ? hh$:'00';
var ii = Math.floor(ts / 60); ii = ii > 0 ? ii`:'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();
}
函數ieFixed(id)
{
var isIE = (document.all) ?真:假;
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);
}
}
腳本>
頭>
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'); // 固定在底部
身體>