인터넷정보

글자가 변하는 뉴스티커 (공지용으로 쓰면 좋습니다.)

알 수 없는 사용자 2007. 10. 17. 13:57


http://oxtag.com/html/ex/fade_ticker.html

<html>

<head>

<STYLE>
#tickertape {HEIGHT: 12px; POSITION: relative; WIDTH: 300px; layer-background-color: black}
#subtickertape
{BACKGROUND-COLOR: black; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; HEIGHT: 12px; POSITION: absolute; WIDTH: 300px}
.subtickertapefont {COLOR: white; FONT: bold 12px Verdana; TEXT-DECORATION: none}
.subtickertapefont A {COLOR: white; TEXT-DECORATION: none}
</STYLE>
<!-- 표시될내용 스타일을 지정하는 부분입니다.  -->

</head>

<body onload="if (document.all||document.layers) {regenerate2();update()}">

<DIV id=tickertape>
<DIV class=subtickertapefont id=subtickertape>Initializing...</DIV>
</DIV>

<SCRIPT language=JavaScript1.2>

/*Fading Ticker Tape Script-by
Dynamic Drive (www.dynamicdrive.com)
Fading background color component by Dave Methvin, Windows Magazine
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com */

var speed=5000
<!-- 기본 속도는 5초이고 알맞게 수정하세요. 1000 = 1초입니다. -->

var news=new Array()

news[0]="<center>카멜롯™의 소스천국 태그피아입니다</center>"
news[1]="<center>하이퍼링크도 거실수 있습니다.</center>"
news[2]="<center><a href='http://oxtag.com' target='_blank'>여기눌러바</a></center>"
<!-- 메시지 개수는 얼마든지 조절 가능 -->

i=0
if (document.all) tickerobject=document.all.subtickertape.style
else tickerobject=document.tickertape.document

function regenerate(){
  window.location.reload()
}

function regenerate2(){
  if (document.layers) setTimeout("window.onresize=regenerate",450)
}

function update(){
  BgFade(0xff,0xff,0xff, 0x00,0x00,0x00,10);
  if (document.layers){
    document.tickertape.document.subtickertape.document.write('<span class="subtickertapefont">'+news[i]+'</span>')
    document.tickertape.document.subtickertape.document.close()
  }
  else document.all.subtickertape.innerHTML=news[i]

  if (i<news.length-1) i++
  else i=0
  setTimeout("update()",speed)
}

function BgFade(red1, grn1, blu1, red2, grn2, blu2, steps) {
  sred = red1; sgrn = grn1; sblu = blu1;
  ered = red2; egrn = grn2; eblu = blu2;
  inc = steps;
  step = 0;
  RunFader();
}

function RunFader() {
  var epct = step/inc;
  var spct = 1 - epct;
  if (document.layers) tickerobject.bgColor = Math.floor(sred * spct + ered * epct)*256*256 + Math.floor(sgrn * spct + egrn * epct)*256 + Math.floor(sblu * spct + eblu * epct);
  else  tickerobject.backgroundColor= Math.floor(sred * spct + ered * epct)*256*256 + Math.floor(sgrn * spct + egrn * epct)*256 + Math.floor(sblu * spct + eblu * epct);
  if ( step < inc ) {
   setTimeout('RunFader()',50);
  }
  step++;
}
</SCRIPT>

</body>

</html>

반응형