Home > Web Front-end > JS Tutorial > Jquery countdown source code sharing_jquery

Jquery countdown source code sharing_jquery

WBOY
Release: 2016-05-16 16:48:03
Original
1259 people have browsed it

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:

Jquery countdown source code sharing_jquery

Code display:

html:

Copy code The code is as follows:

< /span>

jquery:

Copy code The code is as follows:

$().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);
         )()
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template