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

· 13년 전 · 893 · 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,588
13년 전 조회 691
13년 전 조회 1,472
13년 전 조회 995
13년 전 조회 4,045
13년 전 조회 2,041
13년 전 조회 871
13년 전 조회 689
13년 전 조회 1,260
13년 전 조회 890
13년 전 조회 1,028
13년 전 조회 2,117
13년 전 조회 768
13년 전 조회 2,823
13년 전 조회 2,813
13년 전 조회 1,084
13년 전 조회 782
13년 전 조회 2,326
13년 전 조회 899
13년 전 조회 1,150
13년 전 조회 686
13년 전 조회 1,809
가나다라마바사아자차카타파하
13년 전 조회 1,102
13년 전 조회 1,158
13년 전 조회 1,508
13년 전 조회 600
13년 전 조회 3,672
13년 전 조회 911
13년 전 조회 1,797
13년 전 조회 1,293
13년 전 조회 665
13년 전 조회 4,652
13년 전 조회 525
13년 전 조회 2,639
13년 전 조회 990
13년 전 조회 658
13년 전 조회 1,022
13년 전 조회 7,793
13년 전 조회 981
13년 전 조회 2,066
13년 전 조회 1,508
13년 전 조회 1,034
13년 전 조회 4,100
13년 전 조회 702
13년 전 조회 1,191
13년 전 조회 823
13년 전 조회 872
13년 전 조회 1,559
13년 전 조회 2,359
13년 전 조회 894
13년 전 조회 1,014
13년 전 조회 955
13년 전 조회 1,322
13년 전 조회 569
13년 전 조회 1,036
13년 전 조회 540
13년 전 조회 957
가나다라마바사아자차카타파하
13년 전 조회 709
13년 전 조회 1,148
13년 전 조회 1,572
13년 전 조회 1,224
13년 전 조회 9,404
13년 전 조회 1,784
13년 전 조회 3,361
13년 전 조회 482
13년 전 조회 1,466
13년 전 조회 714
13년 전 조회 559
13년 전 조회 553
13년 전 조회 4,319
13년 전 조회 1,514
13년 전 조회 1,997
13년 전 조회 688
13년 전 조회 1,048
13년 전 조회 1,569
13년 전 조회 561
13년 전 조회 1,622
13년 전 조회 1,342
13년 전 조회 3,030
13년 전 조회 1,022
13년 전 조회 2,272
13년 전 조회 1,149
13년 전 조회 1,070
13년 전 조회 1,160
13년 전 조회 1,596
13년 전 조회 1,180
13년 전 조회 555
13년 전 조회 820
13년 전 조회 976
13년 전 조회 646
13년 전 조회 7,377
13년 전 조회 6,402
13년 전 조회 626
13년 전 조회 796
13년 전 조회 1,006
13년 전 조회 621
13년 전 조회 702
13년 전 조회 1,018
13년 전 조회 992
13년 전 조회 2,298
🐛 버그신고