'전광판'에 해당되는 글 1건

  1. 2011.04.20 전광판 스크립트 [출처 : 네이버 지식인] (2)
출처 : http://kin.naver.com/qna/detail.nhn?d1id=1&dirId=1040202&docId=72650135&qb=7KCE6rSR7YyQIOyKpO2BrOumve2KuA==&enc=utf8&section=kin&rank=1&search_sort=0&spq=1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>

<script type="text/javascript">
var SCROLL_TXT = new Array ();

SCROLL_TXT[0] = "<font color=#000000>[09-25 09:18] 흘러가는 글자 소스입니다. 도움이 되셨으면 합니다. </font>&nbsp;&nbsp;&nbsp;&nbsp;";
SCROLL_TXT[1] = "<font color=8fe4e3>[09-24 15:03] 전광판처럼 꾸며서 예쁘게 활용하시기 바랍니다.</font>&nbsp;&nbsp;&nbsp;&nbsp;";
SCROLL_TXT[2] = "<font color=f8a2a2>[09-24 14:44] 흐르는 항목 추가시는 SCROLL_TXT를 추가하시면 됩니다. </font>&nbsp;&nbsp;&nbsp;&nbsp;";
SCROLL_TXT[3] = "<font color=a4de8c>[09-24 11:38] 소스를 복사해서 원하는 위치에 배치시키시면 됩니다. </font>&nbsp;&nbsp;&nbsp;&nbsp;";
SCROLL_TXT[4] = "<font color=dba7ef>[09-24 09:31] 감사합니다. 댓글 달아주는 센스!!</font>&nbsp;&nbsp;&nbsp;&nbsp;";

       
       
var SCROLL_LIST = new Array;
var area_width = 0;
var scrolling_id = 0;
var clock = null;

var delay1 = 2000;
var delay2 = 20;
var move_width = 2;
var G_s = "START";
var G_s2 = "START";

function scroll_txt_init () {
 //area_width = document.getElementById("scroll_text_area").offsetWidth;
 area_width = 472;

 for (var i = 0; i < SCROLL_TXT.length; i++) {
  var div = document.createElement("div");
 
  div.className = 'style2';
  div.id = 'txt' + i;
  div.style.visibility = "visible";7
  div.innerHTML = '<nobr>'+SCROLL_TXT[i]+'</nobr>';
  document.getElementById('scroll_text_area').appendChild(div);


  if (i == 0) {
   document.getElementById("txt" + i).style.left = 0;
  } else if (document.getElementById("txt" + parseInt(i - 1)) && document.getElementById("txt" + parseInt(i - 1)).offsetLeft > 0 && document.getElementById("txt" + parseInt(i - 1)).offsetLeft + document.getElementById("txt" + parseInt(i - 1)).offsetWidth < area_width) {
   document.getElementById("txt" + i).style.left = document.getElementById("txt" + parseInt(i - 1)).offsetLeft + document.getElementById("txt" + parseInt(i - 1)).offsetWidth;
   scrolling_id = i;
  } else {
   document.getElementById("txt" + i).style.left = -1000;
  }
 }

 clock = setTimeout("scroll_txt(1)", delay1);

}

function scroll_prev() {
 if (document.getElementById("txt" + scrolling_id).offsetLeft > -30) {
  if (scrolling_id < 1) {
   scrolling_id = SCROLL_TXT.length - 1;
  } else {
   scrolling_id--;
  }
 } else {
  for (var i = 0; i < SCROLL_TXT.length; i++) {
   if (document.getElementById("txt" + i).offsetLeft + document.getElementById("txt" + i).offsetWidth >= 0) {
    scrolling_id = i;
    break;
   }
  }
 }


 clearTimeout(clock);
 for (var i = 0; i < SCROLL_TXT.length; i++) {
  document.getElementById("txt" + i).style.left = -1000;
 }

 document.getElementById("txt" + scrolling_id).style.left = 0;
 if(G_s=="START"){
  clock = setTimeout("scroll_txt(1)", delay1);
 }
}

function scroll_next() {
 if (document.getElementById("txt" + scrolling_id).offsetLeft < 30) {
  if (scrolling_id < SCROLL_TXT.length - 1) {
   scrolling_id++;
  } else {
   scrolling_id = 0;
  }
 }

 clearTimeout(clock);

 for (var i = 0; i < SCROLL_TXT.length; i++) {
  document.getElementById("txt" + i).style.left = -1000;
 }

 document.getElementById("txt" + scrolling_id).style.left = 0;
 if(G_s=="START"){
  clock = setTimeout("scroll_txt(1)", delay1);
 }
}

function scroll_txt (_num) {
 var ing = false;
 var delay = delay2;

 for (var i = 0; i < SCROLL_TXT.length; i++) {
  if (_num != 1 && document.getElementById("txt" + i).offsetLeft >= 0 && document.getElementById("txt" + i).offsetLeft < move_width) {
   delay = delay1;
  }

  if (document.getElementById("txt" + i).offsetLeft + document.getElementById("txt" + i).offsetWidth >= 0) {
   document.getElementById("txt" + i).style.left = document.getElementById("txt" + i).offsetLeft - move_width;
   ing = true;
  }
 }

 if (!ing) {
  document.getElementById("txt0").style.left = area_width - move_width;
 }

 if (document.getElementById("txt" + scrolling_id).offsetLeft + document.getElementById("txt" + scrolling_id).offsetWidth < area_width) {
  if (SCROLL_TXT[scrolling_id + 1]) {
   scrolling_id ++;
   document.getElementById("txt" + scrolling_id).style.left = area_width;
  } else if (scrolling_id != 0) {
   scrolling_id = 0;
   document.getElementById("txt" + scrolling_id).style.left = area_width;
  }
 }
 clock = setTimeout("scroll_txt()", delay);
}

function scroll_stop () {
  clearTimeout(clock); 
}
function scroll_start () {
 if(G_s2=="START"){
  clock = setTimeout("scroll_txt()", delay2);
 }
}
</script>
<script language="JavaScript">
var G_t=0;
var ad=0;

function Pun(){
 ad++;
 var blink = document.all.tags("BLINK");
 for (var i=0; i < blink.length; i++) {
  if (blink[i].style.visibility == "visible"){
   blink[i].style.visibility="hidden";
  }else{
   blink[i].style.visibility="visible";
  }
 }
 if(ad<6){
  r=setTimeout("Pun()", 350);
 }else{
  for (var i=0; i < blink.length; i++) {
   blink[i].style.visibility="visible";
  }
  clearTimeout(r);
  G_t=0;
  ad=0;
 }
}
function doBlink() {
 G_t++;
 Pun();
}
function startBlink() {
 if (document.all) {
  setInterval("doBlink()",7000);
 }
}
function playstop1(){
 if (G_s=="START"){

  G_s = "STOP";
  G_s2 = "STOP";
  scroll_stop();
  playstop.src = "04_6_.jpg";
 }else{

  G_s = "START";
  G_s2 = "START";
  scroll_start();
  playstop.src = "04_6.jpg";
 }


}
function playstop2(){
 playstop.innerHTML="<img  src=\"sm05.jpg\" border=\"0\" style=\"cursor:pointer\" onclick=\"scroll_start();playstop1()\">";
 G_s = "START";
}
</script>

<style>
.style2 {color:e3e48f;font-weight:bold;font-size:9pt;overflow:hidden;position:absolute;visibility:visible;}
</style>
<table width="671" border="0" cellpadding="0" cellspacing="0">
 <tr>
  <td><img src="04_1.jpg" width="27" height="34" /></td>
  <td><img src="04_2.jpg" width="73" height="34" /></td>
  <td style="cursor:pointer" onclick="scroll_prev()"></td>
  <td width="472" background="04_4.jpg">
   <table width="472" height="33" cellpadding="0" cellspacing="0" border="0">
    <tr><td>
     <div style="overflow:hidden;width:472;height:20px;padding-top:6px;" id="scroll_text_area" onmouseover="scroll_stop();" onmouseout="scroll_start();"></div>
    </td></tr>
   </table>
  </td>
  <td style="cursor:pointer" onclick="scroll_next()"><img src="04_5.jpg" width="24" height="34" /></td>
  <td ><img id="playstop" src="04_6.jpg" width="25" height="34" style="cursor:pointer" onclick="playstop1()"/></td>
  <td></td>
 </tr>
<script language=javascript>scroll_txt_init();</script>
<div id="ment"></div><div id="ment2"></div>
</table>


</BODY>
</HTML>

Posted by Sinoe
TAG

댓글을 달아 주세요

  1. Favicon of http://uyt.lvoutletstorexx.com/ BlogIcon louis vuitton outlet 2013.04.26 13:42  댓글주소  수정/삭제  댓글쓰기

    그 사람됨을 알고자 하면 그의 친구가 누구인가를 알아보라.Topics related articles:


    http://sangug.tistory.com/104 新建文章 5

    http://stqproject.tistory.com/36?nil_openapi=search 新建文章 12

    http://bbolmin.tistory.com/65 新建文章 7

    http://berserk332.tistory.com/157 新建文章 12

  2. Favicon of http://www.pickensprogressonline.com/inc.php BlogIcon toms outlet 2013.05.14 16:13  댓글주소  수정/삭제  댓글쓰기

    운명사랑을 잘 모르겠어

이전 1 다음

DNS server, DNS service 안정적인 DNS서비스 DNSEver