[javascript] 그림자 시계
로빈아빠
본문
그림자 시계
<BODY onload="init();">
<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: 24px; LEFT: 100px; POSITION: absolute; TOP: 30px; WIDTH: 10px; Z-INDEX: 1"></DIV> <!--시계위치-->
<DIV class=time id="tim2" style="FILTER: flipv() alpha(opacity=20); FONT-STYLE: italic; HEIGHT: 20px; LEFT: 50px; POSITION: absolute; TOP: 50px; WIDTH: 200px; Z-INDEX: 1"></DIV> <!--그림자 위치-->
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:40:37 HTML에서 이동 됨]
<BODY onload="init();">
<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: 24px; LEFT: 100px; POSITION: absolute; TOP: 30px; WIDTH: 10px; Z-INDEX: 1"></DIV> <!--시계위치-->
<DIV class=time id="tim2" style="FILTER: flipv() alpha(opacity=20); FONT-STYLE: italic; HEIGHT: 20px; LEFT: 50px; POSITION: absolute; TOP: 50px; WIDTH: 200px; Z-INDEX: 1"></DIV> <!--그림자 위치-->
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:40:37 HTML에서 이동 됨]
관련링크
댓글목록
등록된 댓글이 없습니다.