zoukankan      html  css  js  c++  java
  • 计算您的精彩人生

    如何计算您的精彩人生呢?








    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD><TITLE>计算您的精彩人生</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <META content="MSHTML 6.00.2900.2995" name=GENERATOR></HEAD>
    <BODY onload=showtime() background="temp.JPG"><BR><BR>
    <script language="javascript">
     var biryear = prompt('请输入你的出生年份','1980');
     var birmonth = prompt('请输入你的出生月份','5');
     var birday = prompt('请输入你的出生日','30');
     var year = new Date();
     var getyear = year.getYear();
     TMonth = new Array('Jan','Feb','Mar','Apr','May','June','July','Aug','Sep','Oct','Nov','Dec');
     nowMonth = birmonth - 1;
     bmonth = TMonth[nowMonth];
     var timerid;
     var timerRunning = false;
     var today = new Date();
     var startday = new Date();
     var enday = new Date();
     var minPerDay = 0;
     var secsLeft = 0;
     var secsRound = 0;
     var secsRemain = 0;
     var minLeft = 0;
     var minRound = 0;
     var minRemain = 0;
     var timeRemain = 0;
     function showtime()
     {
      startday = new Date(""+bmonth+" "+birday+", "+biryear+" 00:00 EDT");
      startday.setYear(""+biryear+"");
      today = new Date();
      secsPerDay = 1000 ;
      minPerDay = 60 * 1000 ;
      hoursPerDay = 60 * 60 * 1000;
      PerDay = 24 * 60 * 60 * 1000;
      secsLeft = (today.getTime() - startday.getTime()) / minPerDay;
      secsRound = Math.round(secsLeft);
      secsRemain = secsLeft - secsRound;
      secsRemain = (secsRemain < 0) ? secsRemain = 60 - ((secsRound - secsLeft) * 60) : secsRemain = (secsLeft - secsRound) * 60;
      secsRemain = Math.round(secsRemain);
      minLeft = ((today.getTime() - startday.getTime()) / hoursPerDay);
      minRound = Math.round(minLeft);
      minRemain = minLeft - minRound;
      minRemain = (minRemain < 0) ? minRemain = 60 - ((minRound - minLeft) * 60) : minRemain = ((minLeft - minRound) * 60);
      minRemain = Math.round(minRemain - 0.495);
      hoursLeft = ((today.getTime() - startday.getTime()) / PerDay);
      hoursRound = Math.round(hoursLeft);
      hoursRemain = hoursLeft - hoursRound;
      hoursRemain = (hoursRemain < 0) ? hoursRemain = 24 - ((hoursRound - hoursLeft) * 24)  : hoursRemain = ((hoursLeft - hoursRound) * 24);
      hoursRemain = Math.round(hoursRemain - 0.5);
      daysLeft = ((today.getTime() - startday.getTime()) / PerDay);
      daysLeft = (daysLeft - 0.5);
      daysRound = Math.round(daysLeft);
      daysRemain = daysRound;
      day_rem = " 天 >>> "
      hour_rem = " 小时 >>> "
      min_rem = " 分 >>> "
      sec_rem = " 秒"
      timeRemain = daysRemain + day_rem + hoursRemain + hour_rem + minRemain + min_rem + secsRemain + sec_rem;
      document.up.face.value = timeRemain;
      timerid = setTimeout("showtime()",1000);
      timerRunning = true;
     }
    </SCRIPT>     
    </P>
    <table width="400" height="50" border="1" align="center" cellpadding="4" cellspacing="3" bordercolor="#CCCCCC" bgcolor="#CCFF00">
        <tr>
          <td align="center" valign="middle" bgcolor="#FFFFFF" background="temp.bmp">
       <FORM name=up onsubmit=1>
            <font size="5" color="#9966CC" face="华文行楷">从你出生到目前为止,你已度过了</font>
      <p>
            <INPUT size=46 value="计算出您的精彩人生!" name= "face">
          </FORM>
       </td>
        </tr>
    </table>
    </BODY>
    </HTML>
  • 相关阅读:
    SSR 第二篇,搭建Vue SSR程序
    SSR 第一篇,搭建简单的SSR程序
    数组的所有方法整理学习
    CustomEvent 使用
    VUE CSS module
    eslint Expected linebreaks to be 'LF' but found 'CRLF'
    利用Object.freeze() 提升性能
    vue 项目开启gzip 压缩和性能优化
    [转]Ext Grid控件的配置与方法
    ExtJS renderer(转)
  • 原文地址:https://www.cnblogs.com/paper/p/1534061.html
Copyright © 2011-2022 走看看