非常厉害的javascript 实现指针式时间
function clock () {
var nowtime=new Date()
nowhour=nowtime.getHours()
if (nowhour>=12)
nowhour-=12
nowminute=nowtime.getMinutes()
nowsecond=nowtime.getSeconds()
nowmill=nowtime.getMilliseconds()
var harc,marc,sarc,mmarc
harc=(nowhour+nowminute/60+nowsecond/3600+nowmill/3600000)*30
marc=(nowminute+nowsecond/60+nowmill/60000)*6
sarc=(nowsecond+nowmill/1000)*6
//角度的字符串
nh=(180-harc)*Math.PI/180
harcT=Math.sin(nh)*250+500
harcL=Math.cos(nh)*250+500
harcStr=harcT+","+harcL
document.all.hourline.to.value=harcStr
//分钟的字符串
nm=(180-marc)*Math.PI/180
marcT=Math.sin(nm)*350+500
marcL=Math.cos(nm)*350+500
marcStr=marcT+","+marcL
document.all.minuteline.to.value=marcStr
//秒的字符串
sm=(180-sarc)*Math.PI/180
sarcT=Math.sin(sm)*400+500
sarcL=Math.cos(sm)*400+500
sarcStr=sarcT+","+sarcL
document.all.secondline.to.value=sarcStr
document.all.txt.innerHTML="现在时间是:"+nowtime.getHours()+":"+nowtime.getMinutes()+":"+nowtime.getSeconds()
setTimeout("clock()","50")
}
v\:* { Behavior: url(#default#VML) }
12
3
6
9
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]