Например, вот так: CODE:<style>
.countdown b {
font: 32px Verdana;
font-weight:bold;
color:red;
}
#CD_secs,#CD_days {
font: 20px Verdana;
font-weight:bold;
color:red;
}
#CD_day{
font: 12px Verdana;
color:red;
}
</style>
<div style="position:absolute;top:135px;text-align:center;width:100%;">
<div style="padding-left:320px;" class="countdown">
<B ID=CD_hours>00</B><B ID=to>:</B><B ID=CD_mins>00</B><B ID=CD_secs>00</B>
</div></div>
<script>
function st(num){
if (num > 2000) return '0' + (num - 2000);
else if (num < 10) return '0' + num;
else return num;
}
function cd_timer(){
LastSec--;
if (LastSec < 0) {
clearInterval(timer_id);
}
else{
var secs = LastSec % 60;
var temp = Math.floor(LastSec / 60);
var mins = temp % 60;
temp = Math.floor(temp / 60);
var hours = temp % 24;
var days = Math.floor(temp);
document.getElementById('CD_secs').innerHTML = st(secs);
document.getElementById('CD_mins').innerHTML = st(mins);
document.getElementById('CD_hours').innerHTML = st(hours);
}
}
var now = new Date();
var LastSec = 15*60 + 1;
cd_timer();
var timer_id = setInterval(cd_timer, 1000);
</script> |