标题栏显示时间:
var clocktext; var pagetitle = document.title; function scroll() { today = new Date(); sec = today.getSeconds(); hr = today.getHours(); min = today.getMinutes(); if (hr <= 9) hr = "0" + hr; if (min <= 9) min = "0" + min; if (sec <= 9) sec = "0" + sec; var clocktext = " 现在时间是: " + hr + ":" + min + ":" + sec; clocktimer = setTimeout("scroll()", 1000); document.title = pagetitle + clocktext; } if (document.all) scroll(); // End --> </script> |
演示:
你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=2877858
[2005-08-20] Blog标题栏特效
[2005-08-28] 自动记录、显示页面更新时间
[2005-08-04] 时间规律
[2005-09-02] 追赶时间
[2005-09-02] 追赶时间