发信人: xzhuang()
整理人: microant(1999-08-02 12:13:50), 站内信件
|
【 在 qsyq (情深缘浅) 的大作中提到: 】 Form时钟:注意:请在<body>里加上一句:onLoad="startclock();" 请请参考帮助,注意不要自行修改源代码
在<head>...</head>中插入以下的JavaScript脚本.
<script LANGUAGE="JavaScript">
<!-- var timerID = null var timerRunning = false function stopclock(){ if(timerRunning) clearTimeout(timerID) timerRunning = false }
function startclock(){ 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 if (hours>=6 && hours<=12) {timeValue += ("上午")} if(hours>12 && hours<=18) {timeValue += ("下午")} if(hours>18 && hours <=24) {timeValue +=("晚上")} if(hours<6) {timeValue += ("深夜")} document.clock.face.value = timeValue timerID = setTimeout("showtime()",1000) timerRunning = true }
//--> </script>
在网页的<body> ... </body>中插入以下的表单代码:
<form method="POST" name="clock"> <p><input type="text" name="face" size="11" style="font-size: 9pt"></p> </form>
-- ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.100.15.234] ※ 修改:.eagle 于 Jul 7 14:04:19 修改本文.[FROM: 202.104.34.250]
|
|