head.php 에 넣는 자바스크립트 > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

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

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

본문

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

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

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

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

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



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+"";
}

댓글 전체

전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT