고수님들 소스 보고 해결좀 부탁드립니다..

· 2013-09-17 (화) 21:24:48 · 1073 · 2
<script language='javascript'>
var pop_cnt = parseInt("10");
var now_height = parseInt(-<?=$pop_line_height?>);
var now_list = 1;

function go_time () {
time = setInterval("move_bar()", 50);
}

function move_bar () {

now_height++;
for(i=0;i<pop_cnt;i++)
document.getElementById("tdpop" + i).className = 'rankoff';
document.getElementById("tdpop" + now_list).className = 'rankon';

if (now_height == 0) {
now_list++;
}

if (now_list == pop_cnt) {
clearInterval(time);
now_list = 0;
setTimeout("go_time()", 3000);
}
}

setTimeout("go_time()", 2000);
</script>

이렇게 소스를 작성했습니다.

근데 이상한게

<div id="tdpop0" class="rankon"></div>~<div id="tdpop9" class="rankoff"></div>

까지 해놓고 안에 글을 넣었습니다.

그런데 tdpop0~2 까지만 작동하더니 멈추더라구요.. 또한 그다음 리셋되서 재작동이 안됩니다..

도아주세요 ㅜ_ㅜ.,,
|

댓글 2개

[code]
<script language='javascript'>
var pop_cnt = 10;
var now_list = 1;

function move_bar() {
for(var i=0; i<pop_cnt; i++)
document.getElementById("tdpop" + i).className = 'rankoff';
document.getElementById("tdpop" + now_list).className = 'rankon';
now_list++;
if (now_list == pop_cnt)
now_list = 0;
}
setInterval("move_bar()", 2000);
</script>
[/code]
2013-09-17 (화) 23:37:27
님 감사합니다. ~ 복받으실꺼에요 ~~ 추석 명절 잘보내세요~
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
13-09-18 조회 1,702
13-09-18 조회 1,627
13-09-18 조회 1,632
13-09-17 조회 1,622
13-09-17 조회 1,074
13-09-17 조회 1,045
13-09-17 조회 4,526
13-09-17 조회 1,725
13-09-17 조회 1,264
13-09-17 조회 1,156
13-09-17 조회 1,109
13-09-17 조회 1,637
13-09-17 조회 1,758
13-09-17 조회 1,173
13-09-17 조회 894
13-09-17 조회 1,936
13-09-17 조회 1,400
13-09-17 조회 1,161
13-09-17 조회 1,552
13-09-17 조회 1,775