從天而下MENU
把下列程式碼複製到你網頁原始檔<head>和</head>之間 <script language="JavaScript"> <!-- document.write("<span id='clock'></span>"); var now,hours,minutes,seconds,timeValue; function showtime(){ now = new Date(); hours = now.getHours(); minutes = now.getMinutes(); seconds = now.getSeconds(); timeValue = (hours >= 12) ? "現在是下午 " : "現在是早上 "; timeValue += ((hours > 12) ? hours - 12 : hours) + " 點"; timeValue += ((minutes < 10) ? " 0" : " ") + minutes + " 分"; timeValue += ((seconds < 10) ? " 0" : " ") + seconds + " 秒"; clock.innerHTML = timeValue; setTimeout("showtime()",100); } showtime(); //--> </script> |