티스토리 뷰

Tag & Script/JavaScript

롤링 스크립트

미련곰 2007. 8. 20. 15:23

<script language=javascript>
//롤링 스크립트
 var scrollerheight=125;  // 스크롤러의 세로
 var html,total_area=0,wait_flag=true;
   
 var bMouseOver = 1;
 var scrollspeed = 1;  // Scrolling 속도        
 var waitingtime = 5000;  // 멈추는 시간
 var scroll_content=new Array();
   
 function startscroll(){ // 스크롤 시작
  for (i in scroll_content) insert_area(total_area++); // area 삽입
  window.setTimeout("scrolling()",waitingtime);
 }
 function scrolling(){ // 실제로 스크롤 하는 부분
  if (bMouseOver && wait_flag){
   for (i=0;i<total_area;i++){
    tmp = document.getElementById('scroll_area'+i).style;
    tmp.top = parseInt(tmp.top)-scrollspeed;
    if (parseInt(tmp.top) <= -scrollerheight){
     tmp.top=scrollerheight*(total_area-1);
     wait_flag=false;
     window.setTimeout("wait_flag=true;",waitingtime);
    }
   }
  }
  window.setTimeout("scrolling()",1);
 }
 function insert_area(n){ // area 삽입
  html='<div style="left: 0px; width: 215px; position: absolute; top: '+(scrollerheight*n)+'px" id="scroll_area'+n+'">\n';
  html+=scroll_content[n]+'\n';
  html+='</div>\n';
  document.write(html);
 }
 function jsAct(a,b,c)    
 {
  frmForword = parent.document.frmForword;
  frmForword.top.value=a;  
  frmForword.left.value=b;  
  frmForword.right.value=c;  
  frmForword.target='minwon';  
  frmForword.submit();     
 }

 // 스크롤러에 들어갈 내용들을 태그와 함께 넣어 줍니다


temp_ ="<table width=218 border=0 cellspacing=0 cellpadding=0><tr>";

//1번째줄 1번째
temp_ = temp_ + "<td height=35><a href=http://www.kg21.net/kg21_home.jsp target=_blank><img src=../img/banner_copy01.gif width=99 height=32 border=0></a></td>";
//1번째줄 2번째
temp_ = temp_ + "<td><a href=http://www.moge.go.kr/ target=_blank><img src=../img/banner_copy02.gif width=103 height=35 border=0></a></td>";

temp_ = temp_ + "</tr></table>";

scroll_content[0] = temp_

temp_ ="<table width=218 border=0 cellspacing=0 cellpadding=0><tr>";

//2번째줄 1번째
temp_ = temp_ + "<td height=35><a href=http://woman.gyeonggi.go.kr/ target=_blank><img src=../img/banner_copy03.gif width=103 height=35 border=0></a></td>";
//2번째줄 2번째
temp_ = temp_ + "<td><a href=http://www.womanpia.or.kr/ target=_blank><img src=../img/banner_copy04.gif width=103 height=30 border=0></a></td>";

temp_ = temp_ + "</tr></table>";

scroll_content[1] = temp_

temp_ ="<table width=218 border=0 cellspacing=0 cellpadding=0><tr>";

//3번째줄 1번째
temp_ = temp_ + "<td height=35><a href=http://gg.go.kr/sohn/main/main.jsp target=_blank><img src=../img/banner_copy05.gif width=103 height=35 border=0></a></td>";
//3번째줄 2번째
temp_ = temp_ + "<td><a href=http://www.worlddmz.com/ target=_blank><img src=../img/banner_copy06.gif width=113 height=41 border=0></a></td>";

temp_ = temp_ + "</tr></table>";

scroll_content[2] = temp_

temp_ ="<table width=218 border=0 cellspacing=0 cellpadding=0><tr>";

//4번째줄 1번째
temp_ = temp_ + "<td height=35><a href=http://gfwdi.or.kr/ target=_blank><img src=../img/banner_copy07.gif width=103 height=24 border=0></a></td>";
//4번째줄 2번째
temp_ = temp_ + "<td>&nbsp;</td>";

temp_ = temp_ + "</tr></table>";

scroll_content[3] = temp_

</script>


출처 : http://blog.naver.com/dusen1028/120025720579

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함