zoukankan      html  css  js  c++  java
  • [Javascript] Countdown clock with Javascript and PHP

    代码
    <?php
    $time
    = date("M d, Y", strtotime('2010-09-28'));
    ?>
    <script type="text/javascript">
    //<![CDATA[
    function getRTime()
    {
    var EndTime = Date.parse('<?php echo $time;?>');
    var NowTime = new Date();
    var nMS =EndTime - NowTime.getTime();
    var nH=Math.floor(nMS/(1000*60*60));
    var nM=Math.floor(nMS/(1000*60)) % 60;
    var nS=Math.floor(nMS/1000) % 60;
    document.getElementById("remainH").html(nH);
    document.getElementById(
    "remainM").html(nM);
    document.getElementById(
    "remainS").html(nS);
    setTimeout(
    "getRTime()",1000);
    }
    getRTime();
    //]]>
    </script>
    代码
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr class="title">
    <td width="20%" rowspan="2" class="nfont">time left</td>
    <td width="28%">hours</td>
    <td width="26%">mins</td>
    <td width="26%">secs</td>
    </tr>
    <tr class="number">
    <td id="remainH">0</td>
    <td id="remainM">0</td>
    <td id="remainS">0</td>
    </tr>
    </table>

  • 相关阅读:
    第二阶段冲刺7
    第二阶段冲刺6
    课后作业02需求分析
    阅读计划
    个人总结
    第十六周学习进度条
    第十五周学习进度条
    《梦断代码》阅读笔记03
    《梦断代码》阅读笔记02
    《梦断代码》阅读笔记01
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1837581.html
Copyright © 2011-2022 走看看