当前位置:开发者网络 >> 网页特效 >> 日期时间 >> 内容
精彩推荐
分类最新特效
分类热点特效
  
这是一个可以在页面上任意位置显示的时钟
日期:2005-06-10   人气:   【字体: 】【收藏此文


<!-- 网页特效代码由[中国WEB开发者网络:http://www.ChinaWebDev.com]提供! -->
<!-- 要实现此效果需要 2 个步骤: -->

<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->

<BODY bgcolor="#ffffff" ONLOAD=show5()>



<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->

<span id=liveclock style=position:absolute;left:312px;top:181px;; width: 109px; height: 15px>
</span>
<script language=javascript>



<!--
function show5(){if(!document.layers&&!document.all)

return

var Digital=new Date()
var hours=Digital.getHours()

var minutes=Digital.getMinutes()

var seconds=Digital.getSeconds()

var dn="AM"

if(hours>12){dn="PM"

hours=hours-12



}if(hours==0)



hours=12



if(minutes<=9)



minutes="0"+minutes



if(seconds<=9)



seconds="0"+seconds



//change font size here to your desire



myclock="<font size='5' face='Arial' ><b><font size='1'>Current Time:</font></br>"+hours+":"+minutes+":"



+seconds+" "+dn+"</b></font>"



if(document.layers){document.layers.liveclock.document.write(myclock)



document.layers.liveclock.document.close()



}else if(document.all)



liveclock.innerHTML=myclock



setTimeout("show5()",1000)



}



//-->



</script>
<script language="JavaScript">







<!-- hide



function goHist(a)
{
history.go(a);
}
//-->
</script>