كود ساعه حائط جميله
ضع الكود باى مكان يقبل الHTML
- الكود:
-
<script language="VBScript">
Dim a
Dim min1
Dim hr1
Dim sec1
'Initializes clock and tells it how to behave, when to start animation, etc
Sub window_onload
a = time
min1 = minute(time)
hr1 = hour(time)
if hr1 > 12 then
hr1 = hr1 - 12
end if
sec1 = second(time)
call sgSecondHand.Rotate(0,0,sec1*6 - 90)
call sgMinuteHand.Rotate(0,0,min1*6 - 90)
call sgHourHand.Rotate(0,0,hr1*360/12 - 90)
call seq("Time").Play
end Sub
'Sequencer initilization
Sub Seq_OnInit
Call seq("Time").at(0.000, "SecRot", -1, 1.000, 1)
Call seq("Time").at(60.000, "MinRot", -1, 60.000, 1)
Call seq("Time").at(0.000, "HourRot", -1, 1800.000, 1)
End Sub
'rotates second hand of clock
Sub SecRot
Call sgSecondHand.Rotate(0,0,6)
End Sub
' rotates minute hand of clock
Sub MinRot
Call sgMinuteHand.Rotate(0,0,6)
End Sub
' rotates hour hand of clock
Sub HourRot
Call sgHourHand.Rotate(0,0,15)
End Sub
</script>
<!-- This is the master div, sets over all height, width and positioning-->
<div id="MASTERLAYOUT" STYLE="POSITION:ABSOLUTE;WIDTH:300; HEIGHT:300;TOP:25%;LEFT:25%">
<!-- Div sets positioning of text on clock face, z-index tells it to go in front of background data in master div -->
<div id="divTimeText" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;z-index:2">
<br>
<br>
<br>
<p align="center">
<font face="Verdana,Tahoma,Arial" size="5" color="YELLOW">
<BR>
<BR>
</font>
</p>
<!-- Object displays the numbers on the clock face -->
<OBJECT ID="SgNumbers"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE= "POSITION:ABSOLUTE; WIDTH:215; HEIGHT:200; TOP:0; LEFT:0;Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0004" VALUE="SetFillColor(255,255,255)">
<PARAM NAME="Line0005" VALUE="SetFont('ARIAL',24,650,0,0,0)">
<PARAM NAME="Line0006" VALUE="Text('1',30,-66,0">
<PARAM NAME="Line0007" VALUE="Text('2',60,-36,0">
<PARAM NAME="Line0008" VALUE="Text('3',70,4,0">
<PARAM NAME="Line0009" VALUE="Text('4',60,44,0">
<PARAM NAME="Line0010" VALUE="Text('5',30,74,0">
<PARAM NAME="Line0011" VALUE="Text('6',-10,89,0">
<PARAM NAME="Line0012" VALUE="Text('7',-50,79,0">
<PARAM NAME="Line0013" VALUE="Text('8',-85,44,0">
<PARAM NAME="Line0014" VALUE="Text('9',-95,4,0">
<PARAM NAME="Line0015" VALUE="Text('10',-85,-36,0">
<PARAM NAME="Line0016" VALUE="Text('11',-60,-61,0">
<PARAM NAME="Line0017" VALUE="Text('12',-20,-76,0">
</OBJECT>
</div>
<!-- Creates the clock face , structured graphic-->
<OBJECT ID="sgBackground"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200">
<PARAM NAME="Line0001" VALUE="SetLineStyle(5)">
<PARAM NAME="Line0002" VALUE="SetFillStyle(11)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0,0,0,255)">
<PARAM NAME="Line0004" VALUE="SetGradientFill(0,0,-100,-100,0)">
<PARAM NAME="Line0005" VALUE="Oval(-100,-100,200,200,0)">
</OBJECT>
<div id="divClock" STYLE="POSITION:ABSOLUTE; WIDTH:200; HEIGHT:200; TOP:0; LEFT:0;">
<!-- Object creates second hand for clock, structured graphic -->
<OBJECT ID="sgSecondHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 255, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,255,255)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-2,100,4,0)">
</OBJECT>
<!-- Object creates minute hand for clock, structured graphic-->
<OBJECT ID="sgMinuteHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:absolute; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(255, 0, 0)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(255,0,0)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-3,85,6,0)">
</OBJECT>
<!-- Object creates hour hand for clock, structured graphic -->
<OBJECT ID="sgHourHand"
CLASSID = "CLSID:369303C2-D7AC-11D0-89D5-00A0C90833E6"
STYLE="POSITION:ABSOLUTE; TOP:0; LEFT:0; WIDTH:200; HEIGHT:200; Z-INDEX:5">
<PARAM NAME="Line0001" VALUE="SetLineColor(0, 0, 255)">
<PARAM NAME="Line0002" VALUE="SetLineStyle(1)">
<PARAM NAME="Line0003" VALUE="SetFillColor(0,0,255)">
<PARAM NAME="Line0004" VALUE="SetFillStyle(1)">
<PARAM NAME="Line0005" VALUE="Rect(-5,-3,70,6,0)">
</OBJECT>
</div>
</div>
<!-- Sequencer, controls timing and continuation of clock motion -->
<OBJECT ID="Seq"
CLASSID="CLSID:B0A6BAE2-AAF0-11d0-A152-00A0C908DB96">
</OBJECT>
المصدر :: اكواد جافا سكريبت وهتمل - javascript and Html Cods
عدل سابقا من قبل Ahmad SaȜed في 12.08.11 10:14 عدل 1 مرات