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

· 13년 전 · 881 · 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,576
13년 전 조회 681
13년 전 조회 1,462
13년 전 조회 987
13년 전 조회 4,037
13년 전 조회 2,032
13년 전 조회 860
13년 전 조회 676
13년 전 조회 1,251
13년 전 조회 879
13년 전 조회 1,018
13년 전 조회 2,106
13년 전 조회 754
13년 전 조회 2,809
13년 전 조회 2,804
13년 전 조회 1,076
13년 전 조회 774
13년 전 조회 2,319
13년 전 조회 890
13년 전 조회 1,141
13년 전 조회 677
13년 전 조회 1,803
가나다라마바사아자차카타파하
13년 전 조회 1,090
13년 전 조회 1,150
13년 전 조회 1,501
13년 전 조회 592
13년 전 조회 3,662
13년 전 조회 904
13년 전 조회 1,786
13년 전 조회 1,286
13년 전 조회 654
13년 전 조회 4,643
13년 전 조회 513
13년 전 조회 2,629
13년 전 조회 982
13년 전 조회 644
13년 전 조회 1,013
13년 전 조회 7,782
13년 전 조회 973
13년 전 조회 2,059
13년 전 조회 1,500
13년 전 조회 1,026
13년 전 조회 4,084
13년 전 조회 690
13년 전 조회 1,182
13년 전 조회 813
13년 전 조회 859
13년 전 조회 1,549
13년 전 조회 2,346
13년 전 조회 882
13년 전 조회 1,002
13년 전 조회 945
13년 전 조회 1,309
13년 전 조회 558
13년 전 조회 1,023
13년 전 조회 526
13년 전 조회 944
가나다라마바사아자차카타파하
13년 전 조회 696
13년 전 조회 1,138
13년 전 조회 1,560
13년 전 조회 1,210
13년 전 조회 9,396
13년 전 조회 1,777
13년 전 조회 3,353
13년 전 조회 472
13년 전 조회 1,452
13년 전 조회 701
13년 전 조회 548
13년 전 조회 544
13년 전 조회 4,306
13년 전 조회 1,505
13년 전 조회 1,987
13년 전 조회 678
13년 전 조회 1,039
13년 전 조회 1,556
13년 전 조회 549
13년 전 조회 1,611
13년 전 조회 1,330
13년 전 조회 3,020
13년 전 조회 1,012
13년 전 조회 2,260
13년 전 조회 1,137
13년 전 조회 1,061
13년 전 조회 1,155
13년 전 조회 1,586
13년 전 조회 1,172
13년 전 조회 545
13년 전 조회 814
13년 전 조회 972
13년 전 조회 635
13년 전 조회 7,367
13년 전 조회 6,388
13년 전 조회 617
13년 전 조회 789
13년 전 조회 997
13년 전 조회 608
13년 전 조회 691
13년 전 조회 1,006
13년 전 조회 980
13년 전 조회 2,283
🐛 버그신고