jquery倒计时

//倒计时
    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);

 

posted @ 2015-03-29 22:20  joy_cn  阅读(86)  评论(0编辑  收藏  举报