|
作者: daxiatt [daxiatt] 论坛用户 | 登录 |
1 用来显示时间 <script>function tick() {var hours, minutes, seconds, xfile; var intHours, intMinutes, intSeconds; var today; today = new Date(); intHours = today.getHours(); intMinutes = today.getMinutes(); intSeconds = today.getSeconds(); if (intHours == 0) {hours = "12:"; xfile = "午夜"; } else if (intHours < 12) {hours = intHours+":"; xfile = "上午"; } else if (intHours == 12) {hours = "12:"; xfile = "正午"; } else {intHours = intHours - 12 hours = intHours + ":"; xfile = "下午"; }if (intMinutes < 10) {minutes = "0"+intMinutes+":"; } else {minutes = intMinutes+":"; }if (intSeconds < 10) {seconds = "0"+intSeconds+" "; } else {seconds = intSeconds+" "; }timeString ="现在时间是:"+ xfile+hours+minutes+seconds; Clock.innerHTML = timeString; window.setTimeout("tick();", 100); }window.onload = tick; </script><div id="Clock" align="center" style="font-size: 12px; color: #0000cc; width: 150; height: 19"></div> 2 <script language="JavaScript"> NS4 = (document.layers) ? 1 : 0; IE4 = (document.all) ? 1 : 0; ver4 = (NS4 || IE4) ? 1 : 0; if (ver4) { with (document) { write("<STYLE TYPE='text/css'>"); if (NS4) { write(".parent {position:absolute; visibility:visible}"); write(".child {position:absolute; visibility:visible}"); write(".regular {position:absolute; visibility:visible}") } else { write(".child {display:none}") } write("</STYLE>"); } } function getIndex(el) { ind = null; for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id == el) { ind = i; break; } } return ind; } function arrange() { nextY = document.layers[firstInd].pageY +document.layers[firstInd].document.height; for (i=firstInd+1; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.visibility != "hide") { whichEl.pageY = nextY; nextY += whichEl.document.height; } } } function initIt(){ if (!ver4) return; if (NS4) { for (i=0; i<document.layers.length; i++) { whichEl = document.layers[i]; if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide"; } arrange(); } else { divColl = document.all.tags("DIV"); for (i=0; i<divColl.length; i++) { whichEl = divColl(i); if (whichEl.className == "child") whichEl.style.display = "none"; } } } function expandIt(el) { if (!ver4) return; if (IE4) { whichEl = eval(el + "Child"); if (whichEl.style.display == "none") { whichEl.style.display = "block"; } else { whichEl.style.display = "none"; } } else { whichEl = eval("document." + el + "Child"); if (whichEl.visibility == "hide") { whichEl.visibility = "show"; } else { whichEl.visibility = "hide"; } arrange(); } } onload = initIt; </script> 为什么时间显示不出来啊???? |
地主 发表时间: 07/31 19:16 |
回复: Runwin.Y [runwin] 论坛用户 | 登录 |
不会的吧!你放错地方了吗? |
B1层 发表时间: 07/31 20:10 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号