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

· 13년 전 · 892 · 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,587
13년 전 조회 689
13년 전 조회 1,471
13년 전 조회 994
13년 전 조회 4,045
13년 전 조회 2,040
13년 전 조회 871
13년 전 조회 689
13년 전 조회 1,260
13년 전 조회 890
13년 전 조회 1,028
13년 전 조회 2,116
13년 전 조회 768
13년 전 조회 2,821
13년 전 조회 2,812
13년 전 조회 1,084
13년 전 조회 780
13년 전 조회 2,326
13년 전 조회 898
13년 전 조회 1,150
13년 전 조회 685
13년 전 조회 1,806
가나다라마바사아자차카타파하
13년 전 조회 1,100
13년 전 조회 1,158
13년 전 조회 1,508
13년 전 조회 599
13년 전 조회 3,671
13년 전 조회 911
13년 전 조회 1,797
13년 전 조회 1,293
13년 전 조회 664
13년 전 조회 4,652
13년 전 조회 525
13년 전 조회 2,637
13년 전 조회 990
13년 전 조회 658
13년 전 조회 1,021
13년 전 조회 7,793
13년 전 조회 980
13년 전 조회 2,066
13년 전 조회 1,507
13년 전 조회 1,034
13년 전 조회 4,097
13년 전 조회 702
13년 전 조회 1,190
13년 전 조회 822
13년 전 조회 872
13년 전 조회 1,558
13년 전 조회 2,358
13년 전 조회 893
13년 전 조회 1,013
13년 전 조회 955
13년 전 조회 1,322
13년 전 조회 568
13년 전 조회 1,035
13년 전 조회 540
13년 전 조회 955
가나다라마바사아자차카타파하
13년 전 조회 708
13년 전 조회 1,147
13년 전 조회 1,572
13년 전 조회 1,222
13년 전 조회 9,402
13년 전 조회 1,784
13년 전 조회 3,360
13년 전 조회 482
13년 전 조회 1,465
13년 전 조회 713
13년 전 조회 558
13년 전 조회 553
13년 전 조회 4,319
13년 전 조회 1,512
13년 전 조회 1,996
13년 전 조회 688
13년 전 조회 1,047
13년 전 조회 1,568
13년 전 조회 560
13년 전 조회 1,622
13년 전 조회 1,339
13년 전 조회 3,025
13년 전 조회 1,020
13년 전 조회 2,272
13년 전 조회 1,148
13년 전 조회 1,070
13년 전 조회 1,159
13년 전 조회 1,595
13년 전 조회 1,180
13년 전 조회 555
13년 전 조회 819
13년 전 조회 976
13년 전 조회 646
13년 전 조회 7,376
13년 전 조회 6,401
13년 전 조회 626
13년 전 조회 796
13년 전 조회 1,006
13년 전 조회 621
13년 전 조회 700
13년 전 조회 1,015
13년 전 조회 992
13년 전 조회 2,297
🐛 버그신고