Add a container that displays the countdown on the static page, quote the following script, and substitute the time parameters to use.
timeoutDate——Expiration time, the time format is 2014/01/01 or 2014/1/1
D——天
H——hour
M——Minutes
S——Second
xs——Number 0~9
Rendering:
Code display:
html:
< /span>
jquery:
$().ready(function () {
CcountDown([, , timeoutDate], ['and D days < font color="#ff0000" size="4">H time M Minutes S Seconds xs expire', '', ''], '#top_tuan_countdown', function () { $('#top_tuan_countdown').remove() }) ;
})
function CcountDown(t, c, _self, fn) {
function nd(d) {
return isNaN(d) ? (d ? new Date(d).getTime( ) : new Date().getTime()) : d * 1000;
}
var e = [nd(t[0]), nd(t[1]), nd(t[2]) ], _s = _self, b;
if (t[0] && e[0] > e[1]) {
$(_s).html(c[1]);
return ;
} else if (e[1] > e[2]) {
fn && fn($(_s));
$(_s).html(c[2]);
return; l / 36000 / 24, H: l / 36000 % 24, M: l / 600 % 60, S: l / 10 % 60, xs: l / 10 c[0].replace(/D|H|M|S|xs/g, function (m) {
var n = parseInt(k[m]) ''
1 && m != 'D' && m != 'xs') {
function () {
b(l - 1)
}, 100);
)()