这个教学是给我的朋友 黄忆瑾 的 ^^
Dashboard ---> Design ---> Add a Gadget ---> HTML/Java Script
After that add the code below.
<form name="myform"><input value="在线时间" name="clock" size="8" />
</form>
<script language="JavaScript">
var id, iM = 0, iS = 1;
start = new Date();
function go()
{
now = new Date();
time = (now.getTime() - start.getTime()) / 1000;
time = Math.floor( time);
iS = time % 60;
iM = Math.floor( time / 60);
if ( iS < 10)
document.myform.clock.value = " " + iM + " 分 0" + iS + " 秒";
else
document.myform.clock.value = " " + iM + " 分 " + iS + " 秒";
id = setTimeout( "go()", 1000);
}
go();</script>
No comments:
Post a Comment