주간 베스트 월간 베스트 3개월 베스트 베스트 게시물
꽃배달 한국, 중국 전지역배송

시시각각 다른 색으로 변하는 스크롤바

네로 | 2002.01.22 15:15:17 댓글: 0 조회: 371 추천: 3
분류컴관련 강좌·팁 https://life.moyiza.kr/itstudy/1746885
스크롭바의 색이 시간에 따라 주기적으로 바뀝니다. 인터넷익스플로러 5.5 이상 버전에만 적용됩니다.


<body>와 </body> 사이에 아래 소스를 넣습니다.

<script language="javascript">
<!--

var begcolor='#FFFFFF';
var endcolor='#529CFF';
var steps=30;
var delay=35;

if(document.all && document.getElementById){

document.body.style.scrollbarBaseColor=begcolor;
function colorset(num){
this.beg=parseInt('0x'+begcolor.substring(num,num+2));
this.end=parseInt('0x'+endcolor.substring(num,num+2));
this.up=this.startup=(this.end>=this.beg)? true : false;
this.incr=Math.abs(this.end-this.beg)/steps;
this.current=this.beg;
}
function changecolors(){
var color=new Array();
for(i=1;i<=3; i++){
(data[i].up)? data[i].current+=data[i].incr : data[i].current-=data[i].incr;
if(data[i].startup){
if(data[i].current>=data[i].end){ data[i].up=false; data[i].current=data[i].end}
if(data[i].current<=data[i].beg){ data[i].up=true; data[i].current=data[i].beg }
}
if(!data[i].startup){
if(data[i].current<=data[i].end){ data[i].up=true; data[i].current=data[i].end}
if(data[i].current>=data[i].beg){ data[i].up=false; data[i].current=data[i].beg}
}
color[i]=data[i].current;
}
color[4]=Math.floor(color[1]).toString(16); if(color[4].length==1)color[4]='0'+color[4];
color[5]=Math.floor(color[2]).toString(16); if(color[5].length==1)color[5]='0'+color[5];
color[6]=Math.floor(color[3]).toString(16); if(color[6].length==1)color[6]='0'+color[6];
document.body.style.scrollbarBaseColor='#'+color[4]+color[5]+color[6];
}
var data=new Array();
for(i=1, j=1;i<=3; i++, j+=2)data[i]=new colorset(j);
window.onload=function(){ setInterval('changecolors()',delay) }
}

//-->
</script>

#FFFFFF 와 #529CFF 이 두 가지 색을 기본으로 스크롤바 색이 변합니다.
30은 색 변환 속도 ( 클수록 늦어집니다 )
35는 색 변환 중 일시 멈춤 시간 ( 클수록 오랫동안 멈춥니다. )
추천 (3) 선물 (0명)
IP: ♡.157.♡.150
3,006 개의 글이 있습니다.
제목 글쓴이 날짜 조회
관리자
2003-09-20
11846
관리자
2003-09-20
11395
관리자
2003-09-20
20523
지구인
2010-08-27
19325
지구인
2009-09-07
13648
SOLIDH
2010-01-29
15601
엔죠라이프
2004-10-07
16701
태성
2002-02-03
450
태성
2002-02-02
553
네로
2002-01-28
392
네로
2002-01-28
826
네로
2002-01-27
2026
네로
2002-01-27
670
네로
2002-01-27
401
네로
2002-01-27
1920
우추
2002-01-25
583
노아
2002-01-24
2037
김상일
2002-01-23
464
네로
2002-01-22
458
네로
2002-01-22
371
네로
2002-01-22
610
우추
2002-01-18
1069
노아
2002-01-18
2708
네로
2002-01-18
473
네로
2002-01-14
708
우추
2001-12-27
650
우추
2001-12-27
450
우추
2001-12-27
443
모이자 모바일