태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

ie, ff, safari, opera 에서 작동 확인

<html>
<head>
<title> sign_in.htm </title>
<script language="JavaScript">
function startTimer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
enterTime=hours*3600+mins*60+secs;
Timer();
}

function Timer(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
curTime=hours*3600+mins*60+secs
timeSpent();
}

function timeSpent(){
count = curTime - enterTime;
if (count > 3600)
hour = parseInt(count/3600);
else
hour = 0

if (count > 60)
min = parseInt(count/60);
else
min = 0
if (min < 10)
min = "0" + min

sec = parseInt(count - min*60)
if (sec < 10)
sec = "0" + sec
document.timer.counter.value = hour + ":" + min + ":" + sec
window.setTimeout("Timer()",1000)
}

</script>

</head>


<body onload="startTimer()">

<form name="timer" method="get">
my home stay<input type="text" name="counter" size="9">
</form>


</body>
</html>

신고
Posted by 고시랑

티스토리 툴바