// [1단계] 아래의 소스코드를 붙여 넣으세요
<span id="liveclock" style="position:absolute;left:0;top:0;"></span>
// 이곳에서 시계를 보여줄 위치를 설정 하세요
// left:0;top:0 은 왼쪽에서 0픽셀, 위쪽에서 0 픽셀 떨어진 곳에 시계를 보여준다는 말입니다
<script language="JavaScript">
<!--
function show5(){
if (!document.layers&&!document.all&&!document.getElementById) // 크로스 브라우징 구현을 위해
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//아래에서 원하는 형태대로 시계를 설정 하세요
myclock="<font size='4' color=gray face='굴림' ><b>"+hours+":"+minutes+":" +seconds+" "+dn+"</b></font>"
if (document.layers){ //NN 이면
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all) // IE 이면
liveclock.innerHTML=myclock
else if (document.getElementById)
document.getElementById("liveclock").innerHTML=myclock
setTimeout("show5()",1000)
}
window.onload=show5
//-->
</script>
// 여기까지 입니다<!---->
<span id="liveclock" style="position:absolute;left:0;top:0;"></span>
// 이곳에서 시계를 보여줄 위치를 설정 하세요
// left:0;top:0 은 왼쪽에서 0픽셀, 위쪽에서 0 픽셀 떨어진 곳에 시계를 보여준다는 말입니다
<script language="JavaScript">
<!--
function show5(){
if (!document.layers&&!document.all&&!document.getElementById) // 크로스 브라우징 구현을 위해
return
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
hours=hours-12
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//아래에서 원하는 형태대로 시계를 설정 하세요
myclock="<font size='4' color=gray face='굴림' ><b>"+hours+":"+minutes+":" +seconds+" "+dn+"</b></font>"
if (document.layers){ //NN 이면
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (document.all) // IE 이면
liveclock.innerHTML=myclock
else if (document.getElementById)
document.getElementById("liveclock").innerHTML=myclock
setTimeout("show5()",1000)
}
window.onload=show5
//-->
</script>
// 여기까지 입니다<!---->
'java script' 카테고리의 다른 글
페이지를 열면 포스트잇 형태로 열리는 작은 레이어 공지창입니다. (0) | 2011.01.07 |
---|---|
기념일 메세지와 함께 날짜 보여주기 (0) | 2011.01.07 |
상태바에 한글자씩 나타난후 스크롤되어 사라집니다 (0) | 2011.01.07 |
줄맞춰 춤추는 메세지들 (0) | 2011.01.07 |
네츠케이프에서는 반짝반짝, 익스플로러에서는 마키효과 (0) | 2011.01.07 |