1 2 3 4

访客计时器

这个就是人家到你部落格偷看你多久的计时器。

1。Design > Add a Gadget > HTML/Java Script > Copy and paste 以下的 code:

<center><form name="myform">
<td valign="top" width="135">
<input value="在线时间" name="clock" size="8"/></td>
</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></center>

2。按 save。完成啦。:) 

1 comment:

Unknown said...

要放在什么字后面?

Post a Comment

帮我按ads by nuffnang ♥