中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

JS 實(shí)現(xiàn)時(shí)間倒計(jì)時(shí)

2018-07-20    來(lái)源:open-open

容器云強(qiáng)勢(shì)上線!快速搭建集群,上萬(wàn)Linux鏡像隨意使用
<script type="text/javascript">
var maxtime = 1350057600 //截止到的日期
var now=parseInt((new Date().getTime())/1000);//獲取當(dāng)前的日期
var cha_time=maxtime-now;//中間所差的時(shí)間

下面方法把相差的時(shí)間組合成倒計(jì)時(shí)的字符串,然后放到頁(yè)面相應(yīng)位置實(shí)現(xiàn),實(shí)時(shí)刷新
function CountDown(){  
if(cha_time>=0){
var day = Math.floor(cha_time/3600/24);
var hour= Math.floor((cha_time/3600)%24);
var minutes = Math.floor((cha_time/60)%60);  
var seconds = Math.floor(cha_time%60);  
msg = "離結(jié)束還有"+day+"天"+hour+"小時(shí)"+minutes+"分"+seconds+"秒"; 
$(".ws_sg_con_big,.ws_sg_con_small").find("dd").html(msg);
--cha_time;  
}  
else{  
clearInterval(timer);  
alert("時(shí)間到,結(jié)束!");  
}  
}  
timer = setInterval("CountDown()",1000); 
</script>

標(biāo)簽:

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。

上一篇:Google圖像對(duì)比基本算法的簡(jiǎn)單實(shí)現(xiàn)

下一篇:Linux下C語(yǔ)言獲取所有網(wǎng)卡信息的代碼