⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s0004.htm

📁 JavaScript源代码全集
💻 HTM
字号:
<!--Saved  from《天索星网》http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!-- A:link {text-decoration: none; color:#000000}
     A:visited {text-decoration: none; color: #000000}
     A:active {text-decoration: none; color: #FF0000}
     A:hover {text-decoration: underline; color: FF0000}
     body{font-size=9pt}
	    TH{FONT-SIZE: 9pt}
       TD{ FONT-SIZE: 9pt}-->
</style>
<script LANGUAGE="JavaScript">
<!-- Hide
  var timerID = null
  var timerRunning = false
  function MakeArray(size) 
  {
  this.length = size;
  for(var i = 1; i <= size; i++)
  {
  this[i] = "";
  }
  return this;
  }
  function stopclock (){
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false
  }
  function showtime () {
  var now = new Date();
  var year = now.getYear();
  var month = now.getMonth() + 1;
  var date = now.getDate();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var day = now.getDay();
  Day = new MakeArray(7);
  Day[0]="SUN";
  Day[1]="MON";
  Day[2]="TUE";
  Day[3]="WED";
  Day[4]="THU";
  Day[5]="FRI";
  Day[6]="SAT";
  var timeValue = "";
  timeValue += (Day[day]) + "   ";
  timeValue += ((month < 10) ? " 0" : " ") + month + "-";
  timeValue += date + "-" + year + "    ";
  timeValue += ((hours <= 12) ? hours : hours - 12);
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  timeValue += (hours < 12) ? " AM" : " PM";
  document.jsfrm.face.value = timeValue;
  timerID = setTimeout("showtime()",1000);
  timerRunning = true
  }
  function startclock () {
  stopclock();
  showtime()
  }
  //-->

</script>

<title>《网络教程》之Javascript--显示星期,日期和走动的时间</title>
</head>

<body topmargin="0" leftmargin="0" onLoad="startclock();">
<div align="center"><center>

<table border="0" width="90%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" colspan="3"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="250"><img src="../photo/jx.gif" border="0" WIDTH="200" HEIGHT="80"></td>
        <td width="468" height="60"></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#C8C882" valign="middle" align="center" height="22"></td>
    <td width="80%" bgcolor="#C8C882" valign="middle" align="center" colspan="2" height="22"><strong><span style="font-size: 10pt; font-family: Arial">javascript时间类</span></strong></td>
  </tr>
  <tr>
    <td width="20%" valign="top" align="left"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">时间类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">文字类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">导航类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">鼠标类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">按钮类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">跑马灯</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm"><strong><font face="Arial">COOKIE</font></strong>类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="30" bgcolor="#C8C882"><span style="font-size: 9pt"><a href="index.htm">其他类</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="10" bgcolor="#505028"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="80%" valign="top" align="left" colspan="2"><div align="center"><center><table border="0" width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%" bgcolor="#EBEBEB" valign="middle" align="center" height="18" colspan="3"><span style="font-size: 9pt"><a name="显示星期,日期和走动的时间">显示星期,日期和走动的时间</a></span></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="2" colspan="3"></td>
      </tr>
      <tr>
        <td width="100%" valign="middle" align="center" height="1" colspan="3" bgcolor="#000080"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="22"></td>
        <td width="67%" valign="middle" align="center" height="22"><form NAME="jsfrm">
          <p><input TYPE="text" NAME="face" size="35" value></p>
        </form>
        <p> </td>
        <td width="17%" valign="middle" align="center" height="22"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="20"></td>
        <td width="67%" valign="middle" align="left" height="20"><span style="color: rgb(255,0,0)"><font color="#FF0000">拷贝下面的代码到你的html文件的&lt;head&gt;和&lt;/head&gt;之间</font></span></td>
        <td width="17%" valign="middle" align="center" height="20"></td>
      </tr>
      <tr>
        <td width="16%" valign="middle" align="center" height="22" rowspan="4"></td>
        <td width="67%" valign="middle" align="center" bgcolor="#F0FAFF"><span style="font-size: 9pt"><textarea rows="10" name="S1" cols="40" onMouseOver="this.focus()" onFocus="this.select()">&lt;script LANGUAGE=&quot;JavaScript&quot;&gt;
<!-- Hide  var timerID = null  var timerRunning = false  function MakeArray(size)   {  this.length = size;  for(var i = 1; i <= size; i++)  {  this[i] = "";  }  return this;  }  function stopclock (){  if(timerRunning)  clearTimeout(timerID);  timerRunning = false  }  function showtime () {  var now = new Date();  var year = now.getYear();  var month = now.getMonth() + 1;  var date = now.getDate();  var hours = now.getHours();  var minutes = now.getMinutes();  var seconds = now.getSeconds();  var day = now.getDay();  Day = new MakeArray(7);  Day[0]="SUN";  Day[1]="MON";  Day[2]="TUE";  Day[3]="WED";  Day[4]="THU";  Day[5]="FRI";  Day[6]="SAT";  var timeValue = "";  timeValue += (Day[day]) + "   ";  timeValue += ((month < 10) ? " 0" : " ") + month + "-";  timeValue += date + "-" + year + "    ";  timeValue += ((hours <= 12) ? hours : hours - 12);  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;  timeValue += (hours < 12) ? " AM" : " PM";  document.jsfrm.face.value = timeValue;  timerID = setTimeout("showtime()",1000);  timerRunning = true  }  function startclock () {  stopclock();  showtime()  }  //-->

&lt;/script&gt;
</textarea></span></td>
        <td width="17%" valign="middle" align="center" height="22" rowspan="4"></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="25" bgcolor="#F0FAFF"><span style="font-size: 9pt; color: rgb(255,0,0)">修改你的&lt;body&gt;语句为;<font color="#008080">&lt;BODY onLoad=&quot;startclock();&quot;&gt;</font></span></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" height="25" bgcolor="#F0FAFF"><font color="#FF0000">拷贝下面的代码到你的html文件的&lt;body&gt;和&lt;/body&gt;之间</font></td>
      </tr>
      <tr>
        <td width="67%" valign="middle" align="left" bgcolor="#F0FAFF">&lt;FORM NAME='jsfrm'&gt;<br>
        &lt;INPUT TYPE=text NAME='face' size=35 value=''&gt;<br>
        &lt;/FORM&gt;</td>
      </tr>
    </table>
    </center></div></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center" height="20"></td>
    <td width="60%" height="20"></td>
    <td width="20%" height="20"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center"></td>
    <td width="60%" height="10"><p align="center"><span style="font-size: 9pt"><a href="s0003.htm">上一页</a> &nbsp;&nbsp;&nbsp; <a href="s0005.htm">下一页</a></span></td>
    <td width="20%"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center"></td>
    <td width="60%" height="10"></td>
    <td width="20%"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center"></td>
    <td width="60%" height="10"></td>
    <td width="20%"></td>
  </tr>
  <tr>
    <td width="20%" bgcolor="#FFFFFF" valign="middle" align="center"></td>
    <td width="60%"><div align="center"><center><table cellspacing="0" cellpadding="0">
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt">《天索星网》 
        星网制作 版权所有</span></font></td>
      </tr>
      <tr>
        <td width="100%"><p align="center"><font color="#969696"><span style="font-size: 9pt; font-family: Arial">&copy;2000-2001 All Rights Reserved</span></font></td>
      </tr>
      <tr>
        <td width="100%"></td>
      </tr>
    </table>
    </center></div></td>
    <td width="20%"></td>
  </tr>
</table>
</center></div>
</body>
</html>
<!--Saved  from天索星网  版权所有;http://www.tasoo.2000c.net,E-mail:tasoo_cn@yahoo.com.cn-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -