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

· 13년 전 · 880 · 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,250
13년 전 조회 878
13년 전 조회 1,018
13년 전 조회 2,106
13년 전 조회 754
13년 전 조회 2,809
13년 전 조회 2,803
13년 전 조회 1,075
13년 전 조회 772
13년 전 조회 2,317
13년 전 조회 889
13년 전 조회 1,141
13년 전 조회 675
13년 전 조회 1,802
가나다라마바사아자차카타파하
13년 전 조회 1,090
13년 전 조회 1,148
13년 전 조회 1,500
13년 전 조회 592
13년 전 조회 3,662
13년 전 조회 903
13년 전 조회 1,786
13년 전 조회 1,284
13년 전 조회 653
13년 전 조회 4,641
13년 전 조회 512
13년 전 조회 2,627
13년 전 조회 979
13년 전 조회 643
13년 전 조회 1,012
13년 전 조회 7,781
13년 전 조회 972
13년 전 조회 2,059
13년 전 조회 1,500
13년 전 조회 1,024
13년 전 조회 4,083
13년 전 조회 688
13년 전 조회 1,179
13년 전 조회 811
13년 전 조회 859
13년 전 조회 1,548
13년 전 조회 2,345
13년 전 조회 881
13년 전 조회 1,001
13년 전 조회 944
13년 전 조회 1,309
13년 전 조회 556
13년 전 조회 1,022
13년 전 조회 525
13년 전 조회 943
가나다라마바사아자차카타파하
13년 전 조회 695
13년 전 조회 1,136
13년 전 조회 1,559
13년 전 조회 1,210
13년 전 조회 9,396
13년 전 조회 1,777
13년 전 조회 3,353
13년 전 조회 471
13년 전 조회 1,452
13년 전 조회 701
13년 전 조회 547
13년 전 조회 541
13년 전 조회 4,305
13년 전 조회 1,505
13년 전 조회 1,987
13년 전 조회 677
13년 전 조회 1,037
13년 전 조회 1,554
13년 전 조회 549
13년 전 조회 1,609
13년 전 조회 1,330
13년 전 조회 3,019
13년 전 조회 1,012
13년 전 조회 2,258
13년 전 조회 1,136
13년 전 조회 1,058
13년 전 조회 1,154
13년 전 조회 1,584
13년 전 조회 1,171
13년 전 조회 542
13년 전 조회 814
13년 전 조회 972
13년 전 조회 633
13년 전 조회 7,366
13년 전 조회 6,387
13년 전 조회 615
13년 전 조회 789
13년 전 조회 993
13년 전 조회 608
13년 전 조회 689
13년 전 조회 1,005
13년 전 조회 977
13년 전 조회 2,283
🐛 버그신고