zoukankan      html  css  js  c++  java
  • 倒计时样式


    function countDown(){
    var endDay,endMouse,endYear,endtime,leftsecond,day,hour,minute,second;
    var nowtime = new Date();
    var curHour = nowtime.getHours();
    endDay = nowtime.getDate()+1;
    endMouse = nowtime.getMonth();
    endYear = nowtime.getFullYear();
    endtime=new Date(endYear,endMouse,endDay,10,00,00);
    leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
    day=parseInt(leftsecond/3600/24);
    hour=parseInt((leftsecond/3600)%24);
    if(hour<10){
    hour = "0"+hour;
    };
    minute=parseInt((leftsecond/60)%60);
    if(minute<10){
    minute = "0"+minute;
    };
    second=parseInt(leftsecond%60);
    if(second<10){
    second = "0"+second;
    };
    document.getElementById("djshour").innerHTML=hour;
    document.getElementById("djsminuts").innerHTML=minute;
    document.getElementById("djssecond").innerHTML=second;
    if(curHour >= 10){
    /*10点以后开抢的状态*/
    document.getElementById("djs-id").style.display = "none";
    document.getElementById("kq-cont").style.display="block";
    }else{
    /*时间为10点之前倒计时*/
    document.getElementById("djs-id").style.display = "block";
    document.getElementById("kq-cont").style.display="none";
    }
    }
    countDown();
    window.setInterval(function(){
    countDown();
    },1000);

  • 相关阅读:
    mongoose pre
    socket2
    golang (10 语法)
    golang(7 方法重写)
    npm安装git上的包
    npm 配置
    npm v3版本
    npm v2版本
    awk oneline
    sed oneline
  • 原文地址:https://www.cnblogs.com/ouyang2014/p/4164253.html
Copyright © 2011-2022 走看看