Hjælp til at indsætte to ur-scripts på side.
Jeg har fundet et flot javascript ur, som jeg gerne vil bruge til at lave en side, der viser hvad klokken er i forskellige byer i verden.Jeg skal bare lige bruge lidt hjælp til hvordan jeg indsætter uret flere gange.
<script language="JavaScript">
<!-- Beginning of JavaScript -
var now
var second
var minute
var hour
var degreeSecond
var degreeMinute
var degreeHour
var timer
var stepDegree=6
var stepDegreeHour=30
function checkTime() {
if (document.all) {
now=new Date()
second=now.getSeconds()
minute=now.getMinutes()
hour=now.getHours()
if (hour>=12) {hour=hour-12}
spinIt()
timer=setTimeout("checkTime()",200)
}
}
function spinIt() {
window.status=hour
secondObj.SetIdentity()
minuteObj.SetIdentity()
hourObj.SetIdentity()
degreeSecond=180+stepDegree*second
degreeMinute=180+stepDegree*minute
degreeHour=180+stepDegreeHour*hour+(Math.floor(stepDegree*minute/12))
secondObj.Rotate(0,0,degreeSecond)
minuteObj.Rotate(0,0,degreeMinute)
hourObj.Rotate(0,0,degreeHour)
}
// - End of JavaScript - -->
</script>
<body onLoad="checkTime()">
<DIV style="position:absolute;top:30px;left:200px">
<img src="pic/bgclock1.gif">
</DIV>
<DIV style="position:absolute;top:30px;left:200px">
<OBJECT ID="secondObj" STYLE="width:100px;height:102px" CLASSID="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
<PARAM NAME="HighQuality" VALUE="1">
<PARAM NAME="Line0001" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0002" VALUE="SetLineColor(80,20,20)">
<PARAM NAME="Line0003" VALUE="SetFillColor(80,20,20)">
<PARAM NAME="Line0004" VALUE="Rect(0,0,1,32)">
</OBJECT>
</DIV>
<DIV style="position:absolute;top:30px;left:200px">
<OBJECT ID="minuteObj" STYLE="width:100px;height:102px" CLASSID="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
<PARAM NAME="HighQuality" VALUE="1">
<PARAM NAME="Line0001" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0002" VALUE="SetLineColor(50,50,50)">
<PARAM NAME="Line0003" VALUE="SetFillColor(50,50,50)">
<PARAM NAME="Line0004" VALUE="Rect(0,0,1,30)">
</OBJECT>
</DIV>
<DIV style="position:absolute;top:30px;left:200px">
<OBJECT ID="hourObj" STYLE="width:100px;height:102px" CLASSID="CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6">
<PARAM NAME="HighQuality" VALUE="1">
<PARAM NAME="Line0001" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0002" VALUE="SetLineColor(50,50,50)">
<PARAM NAME="Line0003" VALUE="SetFillColor(50,50,50)">
<PARAM NAME="Line0004" VALUE="Rect(0,0,1,16)">
</OBJECT>
</DIV>