사이트 내 전체검색
두가지색이 교대로 fade되는 스크롤바
https://cmd.kr/javascript/318 URL이 복사되었습니다.

본문

<HTML>

<title>두가지색이 교대로 fade되는 스크롤바</title>
<BODY>

<!-- 아래의 소스를 <BODY> 태그와 </BODY> 태그안에  넣으세요 -->

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

var begcolor='#FF66CC';      // 시작 색상
var endcolor='#99FF99';      // 마지막 색상
var steps=50;
var delay=50;

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>

<textarea>

출처 : http://www.aircon1004.com/data/bbs/board.php?bo_table=pds1&wr_id=130

댓글목록

등록된 댓글이 없습니다.

831 (13/17P)

Search

Copyright © Cmd 명령어 3.147.80.36