"最后更新日期"
<script language="ja;vascript">
<!--hide script from old browsersdocument.write("本頁最后更新日期: " + document.lastModified + "")// end hiding -->
</script>
拷貝到你的html文件的<body>和</body>之間
走動的數字時鐘
將下面的代碼加入html文件的<head></head>之間
<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>
將下面的代碼加入html文件任意需要的地方
<div id="Clock" align="center" style="font-size: 20; color:#000000"></div>
<script language="ja;vascript">
<!--hide script from old browsersdocument.write("本頁最后更新日期: " + document.lastModified + "")// end hiding -->
</script>
拷貝到你的html文件的<body>和</body>之間
走動的數字時鐘
將下面的代碼加入html文件的<head></head>之間
<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>
將下面的代碼加入html文件任意需要的地方
<div id="Clock" align="center" style="font-size: 20; color:#000000"></div>
标签:最后更新日期
推薦設計
優秀海報設計精選集(8)海報設計2022-09-23
充滿自然光線!32平米精致裝修設計2022-08-14
親愛的圖書館 | VERSE雜誌版版式設計2022-07-11
生活,就該這麼愛!2022天海報設計2022-06-02
最新文章
最后加載廣告的JS代碼其他教程2012-05-23
網頁設計的標準尺寸其他教程2008-03-03
如何讓廣告代碼不影響網其他教程2007-12-11
網頁設計基礎:文字大小的其他教程2007-10-11