• html同一个页面多个倒计时


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">     
    <html>     
     <head>     
      <title>js倒计时代码</title>     
      <meta name="Generator" content="EditPlus">          
        
     </head>     
        
     <body>      
    <script type="text/javascript"> 
         
    function countDown( time_distance,fn )     
    {         
       var timer = setInterval(function()     
       {     
           if(parseInt(time_distance)>0){
                   int_day=Math.floor(time_distance/86400000);
                   int_hour=Math.floor((time_distance-int_day*86400000)/3600000);
                   int_minute=Math.floor((time_distance-int_hour*3600000-int_day*86400000)/60000);
                   int_second=Math.floor((time_distance-int_minute*60000-int_hour*3600000-int_day*86400000)/1000);
                   if(int_hour<10)
                       int_hour="0"+int_hour;
                   if(int_minute<10)
                       int_minute="0"+int_minute;
                   if(int_second<10)
                       int_second="0"+int_second;
                   msg=int_day+"天   &nbsp;"+int_hour+":"+int_minute+":"+int_second;
             fn( msg );
            }else{
                msg = "00:00:00";
                fn(msg);  
            }
            time_distance=time_distance-1000;        
        }, 1000);     
    }     
         </script>
        
    <div id="timer1" style="color:red" mce_style="color:red"></div>     
    <div id="timer2" style="color:red" mce_style="color:red"></div>     
        
     <script type="text/javascript">
         
        countDown( 449427915,function( msg )     
        {     
            document.getElementById('timer1').innerHTML = msg;     
        });     
             
        countDown( 0,function( msg )     
        {     
            document.getElementById('timer2').innerHTML = msg;     
        })     
       
    </script>     
     </body>     
    </html>
  • 相关阅读:
    PatentTips
    PatentTips
    PatentTips
    Xvisor ARM32 启动分析
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
    PatentTips
  • 原文地址:https://www.cnblogs.com/dongming-03/p/5692439.html
Copyright © 2020-2023  润新知