close

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


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

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

<script language = "JavaScript">
<!--
var bc_flg = true;
var bc_mode_flg = true;
var bc_mode = 0;
function b_clock() {
var msg, hour, min, sec, year, month, day;
var date = new Date();
year = date.getYear();
month = date.getMonth() + 1;
day = date.getDate();
var browser = navigator.appName;
if (browser.indexOf("Netscape") == -1) {
year += 1900;
year += "";
}
else {
if (year < 2000) {
year += 1900;
}
year = year.toString(10);
}
year = year.substring(2, year.length);
hour = date.getHours();
if (( min = date.getMinutes() ) < 10) {
min = "0" + min;
}
if (( sec = date.getSeconds() ) < 10) {
sec  = "0" + sec;
}
if (bc_mode == 0) {
msg = hour + " 時 " + min + " 分 " + sec + " 秒 ";
}
else if (bc_mode == 1) {
if ((hour - 12) < 0) {
msg = hour + " : " + min + " : " + sec + " AM ";
}
else {
msg = (hour-12) + " : " + min + " : " + sec + " PM ";
}
}
else if (bc_mode == 2) {
msg = year + " 年 " + month + " 月 " + day + " 日 ";
}
else {
msg = "mode error!";
}
bc_mode_flg = true;
if (bc_flg) {
document.write('<FORM NAME=b_clock_form><INPUT TYPE=button NAME=time VALUE=" " onClick="b_clock_mode()"></FORM>');
bc_flg = false;
}
document.b_clock_form.time.value = msg;
setTimeout("b_clock()", 200);
}
function b_clock_mode() {
if (bc_mode_flg) {
if (bc_mode < 2) {
bc_mode++
}
else {
bc_mode = 0;
}
bc_mode_flg = false;
}
else {
return;
}
}
-->
</script>
<center>
<script language = "JavaScript">
<!--
b_clock();
-->
</script>
</center>

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 〃小豬σ 的頭像
    〃小豬σ

    〃小豬σ的部落格

    〃小豬σ 發表在 痞客邦 留言(0) 人氣()