Blogger Information
Blog 17
fans 1
comment 1
visits 16492
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
清明节倒计时
雷国恩的博客
Original
839 people have browsed it
<!DOCTYPE html>

<html dir="ltr">

  <head>

    <meta charset="utf-8">

    <title></title>

   <style type="text/css">

     #box{

      width: 500px;

      height: 100px;

      margin: 200px auto;

      background: #3AD900;

      text-align: center;

      line-height: 100px;

     }

     #sp{

   width: 212.44px;

   height: 21px;

     }

   </style>

  </head>

  <script type="text/javascript" src="jquery-3.3.1.js"></script>

   

  <body>

   <div id="box">清明倒计时:

    <span>2天14小时37分钟35秒000毫秒</span>

  </div>

   <script>

    $(function(){

     function time(){

      var d=Date.parse('Apr 05,2019');

     var date=new Date()

     var dd=date.getTime();

     var rd=Math.floor((d-dd)/1000);

     var days=Math.floor(rd/86400);

     var hours=Math.floor(rd%86400/3600);

     var minus=Math.floor(rd%3600/60);

     var secos=Math.floor(rd%60);

     var hm=Math.floor((d-dd)%1000);

     if(hm<100){

      if(hm<10){

      hm="00"+hm;

      }else{

      hm="0"+hm;

      }

      

     }

     $('span').text(days+'天'+hours+'小时'+minus+'分钟'+secos+'秒'+hm+"毫秒");

     }

     setInterval(time,1)

    })

    

   </script>

  </body>

</html

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!