108、特酷的手表

108、特酷的手表

脚本说明:

第一步:把如下代码加入<body>区域中

<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>

<DIV style="LEFT: 340px; POSITION: absolute; TOP: 100px">

<DIV style="LEFT: 0px; POSITION: absolute; TOP: 0px"><IMG height=102

src="bgclock.gif" width=100> </DIV>

<DIV

style="COLOR: #444444; FONT-SIZE: 8pt; LEFT: 200px; LETTER-SPACING: 0.6em; LINE-HEIGHT: 200%; POSITION: absolute; TEXT-ALIGN: center; TOP: 20px; WIDTH: 200px; fomnt-family: Verdana"></DIV>

 

 

 

第二步:把<body>中的内容改为:

<BODY bgcolor="#fef4d9" onload=checkTime()>

 

Write a comment

Comments: 0