남은시간 카운트하는 자바스크립트
<SCRIPT language=JavaScript>
function getTime() {
now = new Date();
dday = new Date(2013,02,14,18,00,00);
// 원하는 날짜, 시간 정확하게 초단위까지 기입.
days = (dday - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (dday - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (dday - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (dday - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
document.getElementById("counter1").innerHTML = hoursRound;
document.getElementById("counter2").innerHTML = minutesRound;
document.getElementById("counter3").innerHTML = secondsRound;
newtime = window.setTimeout("getTime();", 1000);
}
</SCRIPT>
<STYLE type=text/css>
/*타임*/
#count {
height: 167px;
color: #000;
padding-left: 100px;
padding-top:130px;
background-image: url(http://www.bb.co.kr/data/201302/IJ13607483252985/12.jpg);
background-repeat: no-repeat;
}
#bt {
height: 16px;
width: 49;
padding-left: 100px;
padding-top: 0px;
}
</STYLE>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD height=167 width=256>
<DIV id=count><SPAN style="FONT: bold 12px Gulim; COLOR: #000" id=counter1></SPAN><FONT style="FONT-FAMILY: '굴림'; size: 7px">시간</FONT> <SPAN style="FONT: bold 12px Gulim; COLOR: #000" id=counter2></SPAN><FONT style="FONT-FAMILY: '굴림'; size: 7px">분</FONT> <SPAN style="FONT: bold 12px Gulim; COLOR: #000" id=counter3></SPAN><FONT style="FONT-FAMILY: '굴림'; size: 7px">초 남음</FONT>
<SPAN style="padding-left:30px;"></SPAN></div>
</TD></TR></TBODY></TABLE>
<SCRIPT>getTime()</SCRIPT>
댓글 1개
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5186 | PHP |
swallow
|
2년 전 | 943 | |
| 5185 | PHP |
swallow
|
2년 전 | 962 | |
| 5184 | PHP |
swallow
|
2년 전 | 539 | |
| 5183 | PHP |
swallow
|
2년 전 | 847 | |
| 5182 | PHP |
swallow
|
2년 전 | 778 | |
| 5181 | 기타 |
swallow
|
2년 전 | 1022 | |
| 5180 | 2년 전 | 574 | |||
| 5179 | 기타 |
swallow
|
2년 전 | 1434 | |
| 5178 | PHP |
swallow
|
2년 전 | 796 | |
| 5177 | JavaScript |
swallow
|
2년 전 | 1493 | |
| 5176 | PHP |
swallow
|
2년 전 | 1189 | |
| 5175 | 2년 전 | 566 | |||
| 5174 | 기타 | 2년 전 | 816 | ||
| 5173 | PHP |
|
2년 전 | 969 | |
| 5172 | PHP |
|
2년 전 | 1253 | |
| 5171 | 기타 |
그누GPT
|
2년 전 | 1556 | |
| 5170 | PHP |
|
2년 전 | 1054 | |
| 5169 | PHP |
|
2년 전 | 1227 | |
| 5168 | PHP |
|
2년 전 | 1200 | |
| 5167 | JavaScript |
|
2년 전 | 998 | |
| 5166 | MySQL | 2년 전 | 1192 | ||
| 5165 | MySQL | 2년 전 | 1256 | ||
| 5164 | PHP | 2년 전 | 1502 | ||
| 5163 | OS |
|
2년 전 | 843 | |
| 5162 | 웹서버 |
|
2년 전 | 893 | |
| 5161 | 웹서버 |
|
2년 전 | 975 | |
| 5160 | PHP |
|
2년 전 | 843 | |
| 5159 | PHP |
|
2년 전 | 907 | |
| 5158 | PHP |
|
2년 전 | 917 | |
| 5157 | PHP |
|
2년 전 | 943 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기