码迷,mamicode.com
首页 > Web开发 > 详细

jquery倒计时

时间:2015-03-29 23:25:59      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:

//倒计时
    function countDown(){
        var endTime=new Date("2015/7/1 00:00:00").getTime();
        var nowTime=new Date().getTime();
        var t=endTime-nowTime;
        var d=Math.floor(t/1000/60/60/24);
        var h=Math.floor(t/1000/60/60%24);
        var m=Math.floor(t/1000/60%60);
        var s=Math.floor(t/1000%60);
        $(".t_d").html(d);
        $(".t_h").html(h);
        $(".t_m").html(m);
        $(".t_s").html(s);
    }
    setInterval(countDown,1000);

 

jquery倒计时

标签:

原文地址:http://www.cnblogs.com/joy-cnblogs/p/4376584.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!