文字時間日期
將下列程式碼複製至<head>程式碼</head>之間。
<SCRIPT Language="JavaScript"> var tiFoStTim12='<span style="font-size:9pt;font-family:\'Tahoma\';color:dodgerblue">'; var tiFoEnTim12='</span>'; var ob1BgTim12=""; var ob0Tim12,ob1Tim12,ob2Tim12; function writeTim12(obj,mes) { if (document.all || document.getElementById) obj.innerHTML=mes; else if (document.layers) { obj.document.open(); obj.document.write(mes); obj.document.close(); } } function setBgCoTim12(obj,color) { if (document.all || document.getElementById) obj.style.backgroundColor=color; else if (document.layers) obj.bgColor=color; } function tokiTim12(){ var dayTim,yeTim,moTim,daTim,jiTim,funTim,byoTim; dayTim=new Date(); yeTim=dayTim.getFullYear(); moTim=dayTim.getMonth()+1; daTim=dayTim.getDate(); jiTim=dayTim.getHours(); funTim=dayTim.getMinutes(); byoTim=dayTim.getSeconds(); if (jiTim <= 9) jiTim = "0" + jiTim; if (funTim <= 9) funTim = "0" + funTim; if (byoTim <= 9) byoTim = "0" + byoTim; writeTim12(ob2Tim12,tiFoStTim12+yeTim+"/"+moTim+"/"+daTim+" "+jiTim+":"+funTim+":"+byoTim+tiFoEnTim12); setTimeout("tokiTim12()",1000); } function pretokeiTim12() { if (document.all || document.getElementById || document.layers) { if (document.all) { ob0Tim12=document.all("FrRTim12"); ob1Tim12=document.all("FrTim12"); ob2Tim12=document.all("MaTim12"); } else if (document.getElementById) { ob0Tim12=document.getElementById("FrRTim12"); ob1Tim12=document.getElementById("FrTim12"); ob2Tim12=document.getElementById("MaTim12"); } else if (document.layers) { ob0Tim12=document.layers["FrRTim12"]; ob1Tim12=ob0Tim12.document.layers["FrTim12"]; ob2Tim12=ob1Tim12.document.layers["MaTim12"]; } if (ob1BgTim12!="") setBgCoTim12(ob1Tim12,ob1BgTim12); tokiTim12(); } } </SCRIPT> <style type="text/css"> <!-- .class1Tim12 {position:absolute;width:120px;top:4px} #FrTim12 {left:0px; top:0px} #MaTim12 {left:0px; top:0px} --> </style> |
將下列程式碼複製至<body 程式碼>的標籤之中。
onLoad="pretokeiTim12()" |
將下列程式碼複製至<body>程式碼</body>之間。
<span id="FrRTim12" style="position:relative" class="class1Tim12"><span id="FrTim12" class="class1Tim12"><span id="MaTim12" class="class1Tim12"></span></span></span> |