Html & Script

상하 흘러가다 멈추고 다시 흘러가는 틱커

페이지 정보

본문

혹시 쓰실 분이 있을까 해서 올려 놓습니다. 바퀴벌레 태그쓰다가 짜증 나신분 한번 쯤 써보셔도 괜찮을 거구요. 공부하시고 싶으실때 쓰셔도 좋고... 혹시 여기다 응용해서 기능 추가 해주시면 더 좋구요..  이상 허접은 물러갑네다.

<body>
<div id="a0" style="position:absolute;height=17;width=200;"></div>
<div id="a1" style="position:absolute;height=15;width=200;font-size:9pt" align='left'></div>
<div id="a2" style="position:absolute;height=13;width=200;background=#ffffff"></div>
<div id="a3" style="position:absolute;height=15;width=200;background=#ffffff"></div>
<div id="a4" style="position:absolute;height=17;width=200;border=1 solid #808080"></div>
<script>

//사용자 설정부분
var kax=new Array("영감을 준 그녀","살랑에 허덕이는 한나라당","어쩔 수 없는 사랑");
var k=0;
var delay=15; //글자정지시간
var time=40;
var start_p=200;//출력창 상단으로 부터 위치
var left_p=130; //출력창 좌측으로 부터 위치
var width_p=170; //출력창 넓이
var end_p=start_p+30;//종료위치
var stop_p=start_p+18;//정지위치
var bcolor='#CCCC66';//출력창배경색
var fcolor='#ffffff';//글자색
var tedu='#ff0000';

//설정변경금지(시스템사용)
document.all.a0.style.top=start_p+14;
document.all.a1.style.top=start_p;
document.all.a2.style.top=start_p;
document.all.a3.style.top=end_p;
document.all.a4.style.top=start_p+14;
document.all.a0.style.left=left_p-5;
document.all.a1.style.left=left_p;
document.all.a2.style.left=left_p;
document.all.a3.style.left=left_p;
document.all.a4.style.left=left_p-5;
document.all.a0.style.width=width_p;
document.all.a1.style.width=width_p;
document.all.a2.style.width=width_p;
document.all.a3.style.width=width_p;
document.all.a4.style.width=width_p;
document.all.a4.style.border.color=tedu;
document.all.a0.style.background=bcolor;
document.all.a1.style.color=fcolor;
document.all["a1"].innerHTML=kax[0];
var j=0;
setInterval("gogo()",time);
function gogo(){

var k1=document.all.a1.style.top;

if(k<delay){
//위치120시 1.5초간 정지
if(parseInt(k1)==stop_p)
{
k=parseInt(k)+1;
//document.all["a3"].innerHTML=k;
var kk=stop_p;
}
//140위치까지 가서 원위치로 순간이동.
else if(parseInt(k1)==end_p){
var kk=start_p;
if(j==kax.length-1){ j=0; }
else{            j++;          }
document.all["a1"].innerHTML=kax[j];
}

//순차적으로 하강
else
{
var kk=parseInt(k1)+1;
}
}

//정지후 다시 하강시 딜레이 원상복귀.
else{
kk=stop_p+1;
k=0;

}
document.all.a1.style.top=kk;
}
</script>
</body>


---------------------------------

Good : http://laintt.net/v04/jslib/textSlider/

관련자료

등록된 댓글이 없습니다.
Today's proverb
바보는 방황하고, 현명한 사람은 여행을 떠난다. (풀러)