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

📄 16.htm

📁 Java Script & VB Script 教程
💻 HTM
字号:
<html>

<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=gb2312">
<title>简易时钟</title>
</head>
<!--◆程式展示(原始码)◆-->
<script language="JavaScript">
<!--  
var timerID = null
var timerRunning = false

function stopclock(){
    // cannot directly test timerID on DEC OSF/1 in beta 4.
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function startclock(){
     // Make sure the clock is stopped
    stopclock()
    showtime()
}

function showtime(){
    var now = new Date()
    var hours = now.getHours()
    var minutes = now.getMinutes()
    var seconds = now.getSeconds()
    var timeValue = "" + ((hours > 12) ? hours - 12 : hours)
    timeValue  += ((minutes < 10) ? ":0" : ":") + minutes
    timeValue  += ((seconds < 10) ? ":0" : ":") + seconds
    timeValue  += (hours >= 12) ? " P.M." : " A.M."
    document.clock.face.value = timeValue 
    timerID = setTimeout("showtime()",1000)
    timerRunning = true
}
//-->
</script>


<body onload="startclock()" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF"
VLINK="#FF00FF" ALINK="#FF0000" BACKGROUND="../../images/backb.gif">
<!--◆前言◆-->
<div align="center"><center>

<table BORDER="0" WIDTH="470" CELLPADDING="5" CELLSPACING="2">
  <tr>
    <td><p align="center"><font SIZE="6">会</font>觉得连结的时钟、日期很慢吗?是不是开始觉得JAVA的时钟很麻烦呢?您又有一个新选择了!就是用Java 
    Script 
    写出来的线上时钟及日期显示,不但快,而且详细立即!连状态列都有时钟,很不错唷! 
    </p>
    <form name="clock" onsubmit="0">
      <p><input type="text" name="face" size="14" value></p>
    </form>
    </td>
  </tr>
</table>
</center></div><div align="center"><center>

<table BORDER="0" WIDTH="470">
  <tr>
    <td></td>
    <td></td>
  </tr>
  <tr>
    <td ALIGN="LEFT" BGCOLOR="#fde2bf" WIDTH="420"><font SIZE="+1">加入网页步骤:</font></td>
  </tr>
  <tr>
    <td></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table BORDER="0" WIDTH="450">
  <tr>
    <td><ol>
      <li>将以下的控制码先复制起来。<font color="#fbb339">(用滑鼠将底下的一堆黑色部份的程式码,标记起来,按滑鼠右键选择【复制】就行啦!)</font> 
      </li>
      <li>然後在网页中的 &lt;/HEAD&gt; 
        之後将刚刚复制的东西贴上就大功告成了!<font color="#fbb339">(按滑鼠右键选择【贴上】就行啦!)</font> 
      </li>
      <li>最後,更改原始码中的内容就可以了!<font color="#fbb339">(就是紫红色的地方,改成您想要的内容即可!)</font> 
      </li>
    </ol>
    <p align="center"><!--◆列出原始码◆--> </p>
    <div align="center"><center><table BORDER="0" WIDTH="390">
      <tr>
        <td BGCOLOR="#EBFCFB"><br>
        <font color="#a79ea3">&lt;HTML&gt;<br>
        &lt;HEAD&gt;<br>
        &lt;TITLE&gt;简易时钟&lt;/TITLE&gt;<br>
        &lt;/HEAD&gt;<p></font>&lt;script language=&quot;JavaScript&quot;&gt;<br>
        &lt;!-- <br>
        var timerID = null<br>
        var timerRunning = false</p>
        <p>function stopclock(){<br>
        // cannot directly test timerID on DEC OSF/1 in beta 4.<br>
        if(timerRunning)<br>
        clearTimeout(timerID)<br>
        timerRunning = false<br>
        }</p>
        <p>function startclock(){<br>
        // Make sure the clock is stopped<br>
        stopclock()<br>
        showtime()<br>
        }</p>
        <p>function showtime(){<br>
        var now = new Date()<br>
        var hours = now.getHours()<br>
        var minutes = now.getMinutes()<br>
        var seconds = now.getSeconds()<br>
        var timeValue = &quot;&quot; + ((hours &gt; 12) ? hours - 12 : hours)<br>
        timeValue += ((minutes &lt; 10) ? &quot;:0&quot; : &quot;:&quot;) + minutes<br>
        timeValue += ((seconds &lt; 10) ? &quot;:0&quot; : &quot;:&quot;) + seconds<br>
        timeValue += (hours &gt;= 12) ? &quot; P.M.&quot; : &quot; A.M.&quot;<br>
        document.clock.face.value = timeValue <br>
        timerID = setTimeout(&quot;showtime()&quot;,1000)<br>
        timerRunning = true<br>
        }<br>
        //--&gt;<br>
        &lt;/script&gt;</p>
        <p><font color="#a79ea3">&lt;BODY</font> onload=&quot;startclock()&quot; <font
        color="#a79ea3">&gt;</font></p>
        <p>&lt;form name=&quot;clock&quot; onsubmit=&quot;0&quot;&gt;<br>
        &lt;input type=&quot;text&quot; name=&quot;face&quot; size=&quot;14&quot; value&gt;<br>
        &lt;/form&gt; </p>
        <p><font color="#a79ea3">&lt;/BODY&gt;<br>
        &lt;/HTML&gt;<br>
        </font></td>
      </tr>
    </table>
    </center></div></td>
  </tr>
</table>
</center></div><!--◆常见问题◆-->
<layer src="http://www.spidersoft.com/ads/bwz468_60.htm" visibility="hidden" id="a1" width="600" onload="moveToAbsolute(ad1.pageX,ad1.pageY); a1.clip.height=60;visibility='show';">
</layer>


<p align="center">本站点由<a href="http://www.yesite.com" target="_parent">广州热讯公司</a>与<a
href="http://www.yongchun.com/club" target="_parent">中国网虫俱乐部</a>合作推出<br>
Copy right (c) 1999 </p>
</body>
</html>

⌨️ 快捷键说明

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