이코드만으로는 출력이 안되나요?

· 13년 전 · 886 · 1

<script language="Javascript">
<!--
 var y=0; //y축 좌표
 var count=0; //y축 증가값 리셋
 var contentArray = new Array(); //컨텐츠 내용 배열
 var start=0; //0번부터
 var end=0;  //9번 까지 총 10개의 컨텐츠
 var now=0; //현재 추가하는 번호
 var newDiv;
 var hover=1; //마우스 오버시 0이면 멈춤
 var oTime;
 function addContent() { //컨텐츠 2개 추가
  if(now >= end) now=0;
  var dom = document.getElementById("ssinnerBox");
  newDiv = document.createElement("div");
  newDiv.style.height = "18px";
  var sub1 = document.createElement("div");
  sub1.style.paddingBottom = "4px";
  sub1.innerHTML = contentArray[now];
  now++;
  
  newDiv.appendChild(sub1);
  
  dom.appendChild(newDiv);
  
 }
     contentArray[0]="<b>장안동점 / </b>";
     contentArray[1]="<b>제기동점 / </b>";
     contentArray[2]="<b>제기동점 / </b>";
     contentArray[3]="<b>제기동점 / </b>";
     contentArray[4]="<b>제기동점 / </b>";  


   end = 20
 function status() { //롤링 처음 실행시에만 호출
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  addContent();
  setTimeout("run()",1000);
 }
 function run() { //롤링 반복 작업
  oTime = setInterval("rolling()",10);
 }
 function rolling() {
  if(hover==1) {
   y-=1;
   count+=1;
   var dom = document.getElementById("ssinnerBox");
   dom.style.top= y + "px";
   if(count==18) { //롤링을 멈추고 기다림
    count=0;
    addContent();
    clearInterval(oTime); //롤링 멈춤
    setTimeout("run()",1000); // 1초후 다시 롤링 시작
   } else { 
    //oTime = setTimeout("rolling()",10);
   }
  }
 }
 function makeContent() {
  var l = contentArray.length;
  document.write(contentArray[eval(l-1)]);
  
 }
//-->
</script>
 <div id="ssbox">
  <div id="ssinnerBox" onMouseOver="hover=0" onMouseOut="hover=1">
   <script language="javascript">
    addContent();
    status();
   </script>
  </div>
 </div></td>    
    </tr> 
</table>
        <!-- //대리점현황 리스트 추출 -->
        </td>
        <td>&nbsp;</td>
        </tr>
         <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
    </table>
|

댓글 1개

<div id="ssinnerBox" onMouseOver="hover=0" onMouseOut="hover=1">
<script language="javascript">
addContent();
status();
</script>

코드를
<div id="ssinnerBox" onMouseOver="hover=0" onMouseOut="hover=1">
&nbsp;
<script language="javascript">
addContent();
status();
</script>
로 바꾸니 값은 찍히더라구요.

처음 값을 출력하는 쪽을 찾아 보시면 저렇게 안 해도 바로 출력 가능할거 같습니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,583
13년 전 조회 688
13년 전 조회 1,468
13년 전 조회 992
13년 전 조회 4,042
13년 전 조회 2,038
13년 전 조회 866
13년 전 조회 685
13년 전 조회 1,257
13년 전 조회 888
13년 전 조회 1,026
13년 전 조회 2,112
13년 전 조회 762
13년 전 조회 2,817
13년 전 조회 2,806
13년 전 조회 1,083
13년 전 조회 777
13년 전 조회 2,323
13년 전 조회 895
13년 전 조회 1,148
13년 전 조회 682
13년 전 조회 1,804
가나다라마바사아자차카타파하
13년 전 조회 1,095
13년 전 조회 1,155
13년 전 조회 1,504
13년 전 조회 599
13년 전 조회 3,668
13년 전 조회 907
13년 전 조회 1,795
13년 전 조회 1,290
13년 전 조회 661
13년 전 조회 4,651
13년 전 조회 520
13년 전 조회 2,634
13년 전 조회 988
13년 전 조회 655
13년 전 조회 1,019
13년 전 조회 7,790
13년 전 조회 977
13년 전 조회 2,064
13년 전 조회 1,505
13년 전 조회 1,031
13년 전 조회 4,093
13년 전 조회 699
13년 전 조회 1,186
13년 전 조회 819
13년 전 조회 868
13년 전 조회 1,555
13년 전 조회 2,352
13년 전 조회 887
13년 전 조회 1,010
13년 전 조회 950
13년 전 조회 1,319
13년 전 조회 565
13년 전 조회 1,030
13년 전 조회 535
13년 전 조회 951
가나다라마바사아자차카타파하
13년 전 조회 701
13년 전 조회 1,141
13년 전 조회 1,567
13년 전 조회 1,220
13년 전 조회 9,397
13년 전 조회 1,782
13년 전 조회 3,358
13년 전 조회 477
13년 전 조회 1,460
13년 전 조회 709
13년 전 조회 554
13년 전 조회 550
13년 전 조회 4,312
13년 전 조회 1,508
13년 전 조회 1,993
13년 전 조회 685
13년 전 조회 1,044
13년 전 조회 1,563
13년 전 조회 556
13년 전 조회 1,618
13년 전 조회 1,336
13년 전 조회 3,023
13년 전 조회 1,015
13년 전 조회 2,268
13년 전 조회 1,144
13년 전 조회 1,065
13년 전 조회 1,156
13년 전 조회 1,590
13년 전 조회 1,174
13년 전 조회 552
13년 전 조회 815
13년 전 조회 974
13년 전 조회 641
13년 전 조회 7,372
13년 전 조회 6,398
13년 전 조회 622
13년 전 조회 795
13년 전 조회 1,003
13년 전 조회 615
13년 전 조회 696
13년 전 조회 1,009
13년 전 조회 985
13년 전 조회 2,291
🐛 버그신고