特酷的倒影时钟(网页特效)

    文章来源:万象互联 更新时间:2011-12-1 20:39:13
分享:

特酷的倒影时钟,非常漂亮的一个javascript时间特效代码

<head>
<style>
.time { font-size: 12pt; line-height: 14pt; color:red;}
</style>
<SCRIPT language=JavaScript>
<!-- Hiding
var ctimer;

function init(){
if (document.all){
tim2.style.left=tim1.style.posLeft;
tim2.style.top=tim1.style.posTop+tim1.offsetHeight-6;
settimes();
}
}

function settimes(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
if (hours<10)
hours="0"+hours;
if(mins<10)
mins="0"+mins;
if (secs<10)
secs="0"+secs;
tim1.innerHTML=hours+":"+mins+":"+secs
tim2.innerHTML=hours+":"+mins+":"+secs
ctimer=setTimeout('settimes()',960);
}
// Done hiding -->
</SCRIPT>


<DIV class=time id=tim1
style="HEIGHT: 20px; LEFT: 50px; POSITION: absolute; TOP: 10px; WIDTH: 10px"></DIV>
<DIV class=time id=tim2
style="FILTER: flipv() alpha(opacity=20); FONT-STYLE: italic; POSITION: absolute"></DIV>

<body bgcolor="#fef4d9" onload="init()">

版权说明:本站原创文章,由万象互联SEO优化发表.
本文地址:https://www.hulian.top/zixun/post/4591.html
在线咨询
  • 在线时间
  • 8:00-21:00