请问如何能在IE7的状态栏中显示目前系统时间?

来源:百度知道 编辑:UC知道 时间:2024/06/29 01:49:00
问题如上所述,使用的方法不限。

追加一个问题:IE7pro有个超级主页,效果很不错。能否能让IEplus也能够有像这样的主页?(我的主页我作主看着不太爽)

在IE的状态栏里显示当前时间

1.将下面的代码复制到<head>内

<script language="javascript">
var timerID = null;
var timerRunning = false;

function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
}

function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
var timevalue = " " + ((hours >12) ? hours -12 :hours)
timevalue += ((minutes < 10) ? ":0" : ":") + minutes
timevalue += ((seconds < 10) ? ":0" : ":") + seconds
timevalue += (hours >= 12) ? " 下午" : " 上午"
window.status = timevalue;
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock () {
stopclock();
showtime();
}
</script>

2.在<body>