語法展示::  http://home.graffiti.net/likoopr/


請用IE6.0或更新版本觀看語法特效展示

將以下程式碼複製,貼在<head>及</head>標籤之間。

<script language="JavaScript">
<!--
function showMilitaryTime() {
if (document.form.showMilitary[0].checked) {
return true;
}
return false;
}
function showTheHours(theHour) {
if (showMilitaryTime() || (theHour > 0 && theHour < 13)) {
return (theHour);
}
if (theHour == 0) {
return (12);
}
return (theHour-12);
}
function showZeroFilled(inValue) {
if (inValue > 9) {
return "" + inValue;
}
return "0" + inValue;
}
function showAmPm() {
if (showMilitaryTime()) {
return ("");
}
if (now.getHours() < 12) {
return (" AM");
}
return (" PM");
}
function showTheTime() {
now = new Date
document.form.showTime.value = showTheHours(now.getHours()) + ":" + showZeroFilled(now.getMinutes()) + ":" + showZeroFilled(now.getSeconds()) + showAmPm()
setTimeout("showTheTime()",1000)
}
-->
</script>


將以下程式碼複製,貼在插入<body >標籤裡面。

 onLoad="showTheTime()"


將以下程式碼複製,貼在<body>及</body>標籤之間。

<center>
<form name=form>
<input type=text name=showTime size=10><p>
<input type=radio name=showMilitary checked>24小時制<br>
<input type=radio name=showMilitary>12小時制<br>
</form>
</center>

arrow
arrow
    全站熱搜

    紫蓮の翼 發表在 痞客邦 留言(0) 人氣()