<body>
<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><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>
<div id="Clock" align="center" style="font-size: 12px; color: #0000cc; width: 150; height: 19"></div>
<body>
onload被覆盖了

解决方案 »

  1.   

    轻松搞定供参考
    //设计当前时间时期函数
    <!-- 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]="星期天";
      Day[1]="星期一";
      Day[2]="星期二";
      Day[3]="星期三";
      Day[4]="星期四";
      Day[5]="星期五";
      Day[6]="星期六";
      var timeValue = "";
      timeValue += year + "年";
      timeValue += ((month < 10) ? "0" : "") + month + "月";
      timeValue += date + "日  ";
      timeValue += (Day[day]) + "  ";
      timeValue += ((hours <= 12) ? hours : hours - 12);
      timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
      timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
      timeValue += (hours < 12) ? "上午" : "下午";
      document.jsfrm.face.size=44;
      document.jsfrm.face.value = "珍惜时间:"+timeValue;
      
      timerID = setTimeout("showtime()",1000);
      timerRunning = true
      }
      function startclock () {
      stopclock();
      showtime()
      }
      //-->
      

  2.   

    谢谢,基本已经解决了,还有以点点问题,你看一下这个页面http://www.yaguo.com/~zm123/dnjc/home.htm点一下windows98 ,windows2000.....
    的点2次才能点开,如过能帮解决就更好了