사이트 내 전체검색
카운트되는 시계
https://cmd.kr/javascript/388 URL이 복사되었습니다.

본문

<span id="clock" style="POSITION: relative"><b></b></span>
<script>
var clientms=new Date();
var runTime = new Date();
function runClock(){
var clientnow=new Date();
runTime.setTime(runTime.getTime()+(clientnow.getTime()-clientms.getTime()));
clientms.setTime(clientnow.getTime());
if (!document.layers && !document.all) return;
var hours = runTime.getHours();
var minutes = runTime.getMinutes();
var seconds = runTime.getSeconds();
if (minutes <= 9){
minutes = "0" + minutes;
}
if (seconds <= 9){
seconds = "0" + seconds;
}
// 타이머에 보여질 내용들
movingtime = "<b>"+ hours + ":" + minutes + ":" + seconds + "</b>";
// 레이어에 타이머를 써넣습니다
if (document.layers) {
document.layers.clock.document.write(movingtime);
document.layers.clock.document.close();
}
else if (document.all) {
clock.innerHTML = movingtime;
}
setTimeout("runClock()", 999);
}
runClock();
</script>
 

<body> </body> 사이에 들어가야 하네요. ^^

출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=200

댓글목록

등록된 댓글이 없습니다.

831 (5/17P)

Search

Copyright © Cmd 명령어 18.117.75.168