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

· 13년 전 · 890 · 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,585
13년 전 조회 689
13년 전 조회 1,469
13년 전 조회 994
13년 전 조회 4,044
13년 전 조회 2,039
13년 전 조회 870
13년 전 조회 688
13년 전 조회 1,260
13년 전 조회 890
13년 전 조회 1,028
13년 전 조회 2,115
13년 전 조회 768
13년 전 조회 2,821
13년 전 조회 2,810
13년 전 조회 1,084
13년 전 조회 780
13년 전 조회 2,326
13년 전 조회 898
13년 전 조회 1,150
13년 전 조회 684
13년 전 조회 1,806
가나다라마바사아자차카타파하
13년 전 조회 1,100
13년 전 조회 1,158
13년 전 조회 1,506
13년 전 조회 599
13년 전 조회 3,670
13년 전 조회 910
13년 전 조회 1,796
13년 전 조회 1,292
13년 전 조회 664
13년 전 조회 4,652
13년 전 조회 523
13년 전 조회 2,637
13년 전 조회 990
13년 전 조회 657
13년 전 조회 1,021
13년 전 조회 7,792
13년 전 조회 979
13년 전 조회 2,065
13년 전 조회 1,507
13년 전 조회 1,034
13년 전 조회 4,097
13년 전 조회 701
13년 전 조회 1,189
13년 전 조회 822
13년 전 조회 872
13년 전 조회 1,558
13년 전 조회 2,357
13년 전 조회 891
13년 전 조회 1,012
13년 전 조회 954
13년 전 조회 1,322
13년 전 조회 568
13년 전 조회 1,034
13년 전 조회 539
13년 전 조회 955
가나다라마바사아자차카타파하
13년 전 조회 706
13년 전 조회 1,145
13년 전 조회 1,572
13년 전 조회 1,221
13년 전 조회 9,401
13년 전 조회 1,783
13년 전 조회 3,359
13년 전 조회 480
13년 전 조회 1,463
13년 전 조회 710
13년 전 조회 557
13년 전 조회 551
13년 전 조회 4,318
13년 전 조회 1,511
13년 전 조회 1,995
13년 전 조회 687
13년 전 조회 1,047
13년 전 조회 1,568
13년 전 조회 559
13년 전 조회 1,621
13년 전 조회 1,338
13년 전 조회 3,025
13년 전 조회 1,018
13년 전 조회 2,272
13년 전 조회 1,146
13년 전 조회 1,070
13년 전 조회 1,157
13년 전 조회 1,595
13년 전 조회 1,179
13년 전 조회 554
13년 전 조회 818
13년 전 조회 974
13년 전 조회 646
13년 전 조회 7,375
13년 전 조회 6,398
13년 전 조회 626
13년 전 조회 796
13년 전 조회 1,005
13년 전 조회 621
13년 전 조회 699
13년 전 조회 1,011
13년 전 조회 992
13년 전 조회 2,297
🐛 버그신고