테스트 사이트 - 개발 중인 베타 버전입니다

head.php 에 넣는 자바스크립트

· 14년 전 · 1149 · 1
head.php 에 숫자가 하나씩 내려가는 카운트다운 타이머를 자바스크립트로 만들었습니다.
잘동 잘 되고 디스플레이도 참 잘되는데요..

유독 이상하게
게시판 write 페이지 볼때만 아예 안뜨는문제는 뭘까요..;;;
list랑 view볼때는 잘 나옵니다...... ㅜㅜ

베리어블 이름도 안겹치게 복잡한거 만들었고요
js 파일 임풀트도 잘 되어있고요...

도대체 list랑 view 볼때는 잘나오는데 write 볼때는 안나오는 이유가 뭘까요..?? ㅠㅠ

도와주세요 write 페이지 볼때 불러와지는 자바스크립트 펑션이 겹치는거같은데
뭔지 모르곘습니다 ㅠㅠ


[code]
window.onload=WindowLoad;
function WindowLoad(event) {
ActivateCountDown("CountDownPanel", 100);
}

var _countDowncontainer=0;
var _currentSeconds=0;

function ActivateCountDown(strContainerID, initialValue) {
_countDowncontainer = document.getElementById(strContainerID);

if (!_countDowncontainer) {
alert("count down error: container does not exist: "+strContainerID+
"\nmake sure html element with this ID exists");
return;
}

SetCountdownText(initialValue);
window.setTimeout("CountDownTick()", 1000);
}

function CountDownTick() {
if (_currentSeconds <= 0) {
alert("your time has expired!");
return;
}

SetCountdownText(_currentSeconds-1);
window.setTimeout("CountDownTick()", 1000);
}

function SetCountdownText(seconds) {
//store:
_currentSeconds = seconds;

//get minutes:
var minutes=parseInt(seconds/60);

//shrink:
seconds = (seconds%60);

//get hours:
var hours=parseInt(minutes/60);

//shrink:
minutes = (minutes%60);

//build text:
var strText = AddZero(hours) + ":" + AddZero(minutes) + ":" + AddZero(seconds);

//apply:
_countDowncontainer.innerHTML = strText;
}

function AddZero(num) {
return ((num >= 0)&&(num < 10))?"0"+num:num+"";
}

[/code]

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

안나오는 페이지를 링크해 주시면 디버깅하는데 편리하겠네요 :)

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440